X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=app%2Fmain.cpp;h=c320ef8bbddcb7ce6e79df9a1c1efb16c3fa4955;hb=refs%2Ftags%2F12.93.0;hp=38ccfe129e08df40d42f2a315c5cf69a7217e3f4;hpb=bba7642118e223492bf5a82eb3fed04a59e34c2c;p=apps%2Fhvac.git diff --git a/app/main.cpp b/app/main.cpp index 38ccfe1..c320ef8 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -14,30 +14,23 @@ * limitations under the License. */ -#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"); + setenv("QT_QUICK_CONTROLS_STYLE", "AGL", 1); - QQmlApplicationEngine *engine = app.getQmlApplicationEngine(); - QQmlContext *context = engine->rootContext(); - QVariant v = context->contextProperty(QStringLiteral("bindingAddress")); - if(v.canConvert(QMetaType::QUrl)) { - QUrl bindingAddress = v.toUrl(); - context->setContextProperty("hvac", new HVAC(bindingAddress)); - } else { - qCritical("Cannot find bindingAddress property in context, SignalComposer unavailable"); - } + QGuiApplication app(argc, argv); - qmlRegisterType("Translator", 1, 0, "Translator"); - app.load(QUrl(QStringLiteral("qrc:/HVAC.qml"))); - return app.exec(); -} + QQmlApplicationEngine engine; + engine.rootContext()->setContextProperty("hvac", new HVAC()); + qmlRegisterType("Translator", 1, 0, "Translator"); + engine.load(QUrl(QStringLiteral("qrc:/HVAC.qml"))); + return app.exec(); +}