aboutsummaryrefslogtreecommitdiffstats
path: root/sample-qml/calledbyqml.cpp
blob: 5df584a95c7b44db3d3739ae142dd28091099465 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include "calledbyqml.h"
#include <libhomescreen.hpp>
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QQmlContext>


CalledByQml::CalledByQml(QObject *parent) :
    QObject(parent)
{
}

int CalledByQml::consoleout()
{
    qDebug("consoleout method is called");
    LibHomeScreen libHomeScreen;
    libHomeScreen.hardKeyPressed(1);
    return 0;
}

int CalledByQml::showup()
{
    qDebug("showup method is called");
    QGuiApplication app2();
    QQmlApplicationEngine engine2;
    QString target(getenv("AFM_APP_INSTALL_DIR"));
    qDebug("AFM_APP_INSTALL_DIR is " + target.toLatin1());

    if(NULL == target)
    {
        target = ".";
    }

    QString load_path;
    load_path = target + "/main2.qml";
    //engine2.load(QUrl(load_path));
    return 0;
}