diff options
Diffstat (limited to 'app/main.cpp')
-rw-r--r-- | app/main.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
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 <QtGui/QGuiApplication> #include <QtQml/QQmlApplicationEngine> #include <QtQml/QQmlContext> +#include <QtQml/qqml.h> #include <QQuickWindow> #include <QtQuickControls2/QQuickStyle> #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>("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<QQuickWindow *>(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(); } |