X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=app%2Fmain.cpp;h=e4f87bf31dfd4e60373f5918f731ead6834ecde8;hb=39fe8ac90824b966a7281fd5875276611b3c1aba;hp=2fac9aebff50aeae39383d7bbf6016608d90953a;hpb=f4cb3ec807e23788299f9bf1d9c323ff5690aafd;p=apps%2Fhvac.git diff --git a/app/main.cpp b/app/main.cpp index 2fac9ae..e4f87bf 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -1,5 +1,6 @@ /* * Copyright (C) 2016 The Qt Company Ltd. + * Copyright (C) 2022 Konsulko Group * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,18 +15,25 @@ * limitations under the License. */ -#include -#include +#include +#include +#include +#include +#include #include "translator.h" int main(int argc, char *argv[]) { - AGLApplication app(argc, argv); - app.setApplicationName("HVAC"); - app.setupApplicationRole("hvac"); - qmlRegisterType("Translator", 1, 0, "Translator"); - app.load(QUrl(QStringLiteral("qrc:/HVAC.qml"))); - return app.exec(); -} + setenv("QT_QUICK_CONTROLS_STYLE", "AGL", 1); + + QGuiApplication app(argc, argv); + QQmlApplicationEngine engine; + VehicleSignalsConfig vsConfig("hvac"); + engine.rootContext()->setContextProperty("hvac", new HVAC(new VehicleSignals(vsConfig))); + qmlRegisterType("Translator", 1, 0, "Translator"); + engine.load(QUrl(QStringLiteral("qrc:/HVAC.qml"))); + + return app.exec(); +}