diff options
author | Matt Ranostay <matt.ranostay@konsulko.com> | 2020-01-13 22:33:31 -0800 |
---|---|---|
committer | Matt Ranostay <matt.ranostay@konsulko.com> | 2020-01-17 11:00:22 -0800 |
commit | bba7642118e223492bf5a82eb3fed04a59e34c2c (patch) | |
tree | 14a25a73fa3d2ffbffe9a7d9d384d105088ea16c /app/main.cpp | |
parent | b3c59ba3cb5dd7ae849ff5666a948a4cc5c543cb (diff) |
hvac: switch to libqtappfw access for websocket dataicefish_8.99.5icefish/8.99.58.99.5
Remove QML processing of websocket data from appfw, and replace
with new libqtappfw support.
Bug-AGL: SPEC-2984
Change-Id: I0a0a422f25359da48798d3ec5e9948247a83d98e
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Diffstat (limited to 'app/main.cpp')
-rw-r--r-- | app/main.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/app/main.cpp b/app/main.cpp index 2fac9ae..38ccfe1 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -16,6 +16,7 @@ #include <QtAGLExtras/AGLApplication> #include <QtQml/QQmlApplicationEngine> +#include <hvac.h> #include "translator.h" @@ -24,6 +25,17 @@ int main(int argc, char *argv[]) AGLApplication app(argc, argv); app.setApplicationName("HVAC"); app.setupApplicationRole("hvac"); + + 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"); + } + qmlRegisterType<Translator>("Translator", 1, 0, "Translator"); app.load(QUrl(QStringLiteral("qrc:/HVAC.qml"))); return app.exec(); |