summaryrefslogtreecommitdiffstats
path: root/app/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'app/main.cpp')
-rw-r--r--app/main.cpp36
1 files changed, 17 insertions, 19 deletions
diff --git a/app/main.cpp b/app/main.cpp
index 2eef1b0..2327b05 100644
--- a/app/main.cpp
+++ b/app/main.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2016 The Qt Company Ltd.
- * Copyright (C) 2019 Konsulko Group
+ * Copyright (C) 2019,2021 Konsulko Group
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,28 +16,26 @@
*/
#include <QGuiApplication>
-#include <QtQml/QQmlApplicationEngine>
-#include <QtQml/QQmlContext>
-#include <QtGui/QGuiApplication>
-#include <signalcomposer.h>
+#include <QQmlApplicationEngine>
+#include <QQmlContext>
+#include <vehiclesignals.h>
+
#include "translator.h"
int main(int argc, char *argv[])
{
- QGuiApplication app(argc, argv);
- app.setDesktopFileName("dashboard");
+ setenv("QT_QUICK_CONTROLS_STYLE", "AGL", 1);
+
+ QGuiApplication app(argc, argv);
+ app.setDesktopFileName("dashboard");
+
+ QQmlApplicationEngine engine;
+ QQmlContext *context = engine.rootContext();
+ VehicleSignalsConfig vsConfig("dashboard");
+ context->setContextProperty("VehicleSignals", new VehicleSignals(vsConfig));
+ qmlRegisterType<Translator>("Translator", 1, 0, "Translator");
+ engine.load(QUrl(QStringLiteral("qrc:/Dashboard.qml")));
- QQmlApplicationEngine engine;
- QQmlContext *context = engine.rootContext();
- QVariant v = context->contextProperty(QStringLiteral("bindingAddress"));
- if(v.canConvert(QMetaType::QUrl)) {
- QUrl bindingAddress = v.toUrl();
- context->setContextProperty("SignalComposer", new SignalComposer(bindingAddress, context));
- } else {
- qCritical("Cannot find bindingAddress property in context, SignalComposer unavailable");
- }
- qmlRegisterType<Translator>("Translator", 1, 0, "Translator");
- engine.load(QUrl(QStringLiteral("qrc:/Dashboard.qml")));
- return app.exec();
+ return app.exec();
}