Add sample qml application
[staging/HomeScreen.git] / sample-qml / calledbyqml.cpp
1 #include "calledbyqml.h"
2 #include <libhomescreen.hpp>
3 #include <QGuiApplication>
4 #include <QQmlApplicationEngine>
5 #include <QQmlContext>
6
7
8 CalledByQml::CalledByQml(QObject *parent) :
9     QObject(parent)
10 {
11 }
12
13 int CalledByQml::consoleout()
14 {
15     qDebug("consoleout method is called");
16     LibHomeScreen libHomeScreen;
17     libHomeScreen.hardKeyPressed(1);
18     return 0;
19 }
20
21 int CalledByQml::showup()
22 {
23     qDebug("showup method is called");
24     QGuiApplication app2();
25     QQmlApplicationEngine engine2;
26     QString target(getenv("AFM_APP_INSTALL_DIR"));
27     qDebug("AFM_APP_INSTALL_DIR is " + target.toLatin1());
28
29     if(NULL == target)
30     {
31         target = ".";
32     }
33
34     QString load_path;
35     load_path = target + "/main2.qml";
36     //engine2.load(QUrl(load_path));
37     return 0;
38 }