From 6ef082a4a20d56a9ee4c7313bc1675a42606e35a Mon Sep 17 00:00:00 2001 From: Grace Karanja Date: Wed, 27 May 2015 15:36:39 +0300 Subject: Load main.qml on startup for mobile builds When cmake is run with -DSUBSURFACE_MOBILE=True, the initial window will be main.qml, instead of the MainWindow used when cmake is run with -DSUBSURFACE_MOBILE=False Signed-off-by: Grace Karanja Signed-off-by: Dirk Hohndel --- qt-gui.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/qt-gui.cpp b/qt-gui.cpp index 713fd53cd..fdcae2c77 100644 --- a/qt-gui.cpp +++ b/qt-gui.cpp @@ -9,7 +9,9 @@ #include #include #include -#include + +#include +#include #include "qt-gui.h" @@ -28,7 +30,15 @@ void init_ui() void run_ui() { +#ifdef SUBSURFACE_MOBILE + QQmlApplicationEngine engine; + engine.load(QUrl(QStringLiteral("qrc:///qml/main.qml"))); + QObject *mainWindow = engine.rootObjects().value(0); + QQuickWindow *qml_window = qobject_cast(mainWindow); + qml_window->show(); +#else window->show(); +#endif qApp->exec(); } -- cgit v1.2.3-70-g09d2