X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=app%2Fmain.cpp;h=c320ef8bbddcb7ce6e79df9a1c1efb16c3fa4955;hb=95d837913ecb41577980345aeb8a1b3eb710ea2a;hp=b2133f7200553d4187f012955b2fab4bd45c0128;hpb=560062626becb4d211a9948bf3008921129711cf;p=apps%2Fhvac.git diff --git a/app/main.cpp b/app/main.cpp index b2133f7..c320ef8 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -14,33 +14,23 @@ * limitations under the License. */ -#include -#include -#include -#include +#include +#include +#include +#include -#ifdef HAVE_LIBHOMESCREEN -#include -#endif +#include "translator.h" int main(int argc, char *argv[]) { -#ifdef HAVE_LIBHOMESCREEN - LibHomeScreen libHomeScreen; + setenv("QT_QUICK_CONTROLS_STYLE", "AGL", 1); - if (!libHomeScreen.renderAppToAreaAllowed(0, 1)) { - qWarning() << "renderAppToAreaAllowed is denied"; - return -1; - } -#endif + QGuiApplication app(argc, argv); - QGuiApplication app(argc, argv); + QQmlApplicationEngine engine; + engine.rootContext()->setContextProperty("hvac", new HVAC()); + qmlRegisterType("Translator", 1, 0, "Translator"); + engine.load(QUrl(QStringLiteral("qrc:/HVAC.qml"))); - QQuickStyle::setStyle("AGL"); - - QQmlApplicationEngine engine; - engine.load(QUrl(QStringLiteral("qrc:/HVAC.qml"))); - - return app.exec(); + return app.exec(); } -