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>
This commit is contained in:
jan Iversen 2019-11-23 13:09:25 +01:00 committed by Dirk Hohndel
parent 624bd9e7ec
commit 271d058af3

View file

@ -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);