diff options
author | Grace Karanja <gracie.karanja89@gmail.com> | 2015-06-04 13:36:36 +0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-06-20 14:24:25 -0700 |
commit | 315a245868683819031bdefc2e5c8f117b62028d (patch) | |
tree | 0a76fe2f942e2b17c65d7a5dd363fbe145a79505 /qt-gui.cpp | |
parent | e0a25289db50390e92723d6e2298d10f2270ca8a (diff) | |
download | subsurface-315a245868683819031bdefc2e5c8f117b62028d.tar.gz |
Link QMLManager to the main.qml file
Add a link between the C++ and QML parts of the app using the
qmlRegisterType function.
[Dirk Hohndel: changed the name to org.subsurfacedivelog.mobile]
Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-gui.cpp')
-rw-r--r-- | qt-gui.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/qt-gui.cpp b/qt-gui.cpp index 6bc2e1e30..ed893c12e 100644 --- a/qt-gui.cpp +++ b/qt-gui.cpp @@ -15,6 +15,10 @@ #include "qt-gui.h" +#ifdef SUBSURFACE_MOBILE + #include "qt-mobile/qmlmanager.h" +#endif + static MainWindow *window = NULL; void init_ui() @@ -32,6 +36,7 @@ void run_ui() { #ifdef SUBSURFACE_MOBILE window->hide(); + qmlRegisterType<QMLManager>("org.subsurfacedivelog.mobile", 1, 0, "QMLManager"); QQmlApplicationEngine engine; engine.load(QUrl(QStringLiteral("qrc:///qml/main.qml"))); QObject *mainWindow = engine.rootObjects().value(0); |