aboutsummaryrefslogtreecommitdiffstats
path: root/subsurface-helper.cpp
diff options
context:
space:
mode:
authorGravatar jan Iversen <jan@casacondor.com>2019-11-23 13:09:25 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-11-26 09:44:13 -0800
commit271d058af371ffb1851cef439bf13ed4d3c090f0 (patch)
tree233f6c533f1f0be08c4a433aa1b80fdab47cb4bb /subsurface-helper.cpp
parent624bd9e7eca1291a4a7b8caecd6082f08804e99c (diff)
downloadsubsurface-271d058af371ffb1851cef439bf13ed4d3c090f0.tar.gz
startup mobile: test for --testqml when loading qml engine.
the command line option --testqml selects if running using resources or files on disk. Signed-off-by: Jan Iversen <jan@casacondor.com>
Diffstat (limited to 'subsurface-helper.cpp')
-rw-r--r--subsurface-helper.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/subsurface-helper.cpp b/subsurface-helper.cpp
index 0d9e29224..b3266b656 100644
--- a/subsurface-helper.cpp
+++ b/subsurface-helper.cpp
@@ -111,7 +111,17 @@ void run_ui()
ctxt->setContextProperty("connectionListModel", &connectionListModel);
ctxt->setContextProperty("logModel", MessageHandlerModel::self());
+#ifdef SUBSURFACE_MOBILE_DESKTOP
+ if (testqml) {
+ QString fileLoad(testqml);
+ fileLoad += "/main.qml";
+ engine.load(QUrl(fileLoad));
+ } else {
+ engine.load(QUrl(QStringLiteral("qrc:///qml/main.qml")));
+ }
+#else
engine.load(QUrl(QStringLiteral("qrc:///qml/main.qml")));
+#endif
qDebug() << "loaded main.qml";
LOG_STP("run_ui qml loaded");
qqWindowObject = engine.rootObjects().value(0);