#include <QGuiApplication>
#include <QCommandLineParser>
-#include <QtGui/QBitmap>
#include <QtGui/QGuiApplication>
#include <QtQml/QQmlApplicationEngine>
#include <QtQml/QQmlContext>
-#include <QtQml/qqml.h>
#include <QQuickWindow>
#include <QtQuickControls2/QQuickStyle>
#include "eventhandler.h"
-using namespace std;
-
-static EventHandler* eventHandler;
int main(int argc, char *argv[])
{
HMI_DEBUG(APP_ID, "port = %d, token = %s", port, token.toStdString().c_str());
- eventHandler = new EventHandler();
- eventHandler->init(port, token.toStdString().c_str());
-
QQmlApplicationEngine engine;
+ EventHandler *eventHandler = new EventHandler();
+ eventHandler->init(port, token.toStdString().c_str());
engine.rootContext()->setContextProperty("eventHandler", eventHandler);
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
if (engine.rootObjects().isEmpty()) {
QObject *root = engine.rootObjects().first();
QQuickWindow *window = qobject_cast<QQuickWindow *>(root);
-
- eventHandler->setQuickWindow(window);
QObject::connect(eventHandler, SIGNAL(signalLoader(QVariant)), window, SLOT(qmlLoader(QVariant)));
QObject::connect(eventHandler, SIGNAL(signalOnScreenParameter(QVariant)), window, SLOT(qmlOnScreenParameter(QVariant)));
HMI_DEBUG(APP_ID, "Launched!");
-
return app.exec();
}