#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[])
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!");
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();
}