X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=app%2Fmain.cpp;h=7dbd13c8592055fca669050569cc71b1ae80898b;hb=a102c3aac7cf2ec721d5a5039febdd05e303638a;hp=67a6e9e3beb00c4e3fb7d32cb50f0fc8148d7632;hpb=5ba4327b148f81852c6e2a53bc51ab07b238602e;p=apps%2Fonscreenapp.git diff --git a/app/main.cpp b/app/main.cpp index 67a6e9e..7dbd13c 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -19,10 +19,12 @@ #include #include #include +#include #include #include #include "eventhandler.h" +#include "onscreenmodel.h" int main(int argc, char *argv[]) @@ -58,6 +60,7 @@ int main(int argc, char *argv[]) EventHandler *eventHandler = new EventHandler(); eventHandler->init(port, token.toStdString().c_str()); engine.rootContext()->setContextProperty("eventHandler", eventHandler); + qmlRegisterType("OnScreenModel", 1, 0, "OnScreenModel"); engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); if (engine.rootObjects().isEmpty()) { HMI_DEBUG(APP_ID, "Fatal Error, rootObject is empty!"); @@ -66,10 +69,11 @@ int main(int argc, char *argv[]) QObject *root = engine.rootObjects().first(); QQuickWindow *window = qobject_cast(root); - QObject::connect(eventHandler, SIGNAL(signalLoader(QVariant)), window, SLOT(qmlLoader(QVariant))); - QObject::connect(eventHandler, SIGNAL(signalOnScreenParameter(QVariant)), window, SLOT(qmlOnScreenParameter(QVariant))); + QObject::connect(eventHandler, SIGNAL(updateModel(QVariant)), window, SLOT(setOnScreenModel(QVariant))); + QObject::connect(eventHandler, SIGNAL(showOnScreen()), window, SLOT(showOnScreen())); + QObject::connect(eventHandler, SIGNAL(hideOnScreen()), window, SLOT(hideOnScreen())); - HMI_DEBUG(APP_ID, "Launched!"); + HMI_DEBUG(APP_ID, "onscreenapp started!"); return app.exec(); }