mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
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 <gracie.karanja89@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
48a54d0348
commit
6ef082a4a2
1 changed files with 11 additions and 1 deletions
12
qt-gui.cpp
12
qt-gui.cpp
|
@ -9,7 +9,9 @@
|
|||
#include <QDesktopWidget>
|
||||
#include <QNetworkProxy>
|
||||
#include <QLibraryInfo>
|
||||
#include <QTextCodec>
|
||||
|
||||
#include <QQuickWindow>
|
||||
#include <QQmlApplicationEngine>
|
||||
|
||||
#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<QQuickWindow *>(mainWindow);
|
||||
qml_window->show();
|
||||
#else
|
||||
window->show();
|
||||
#endif
|
||||
qApp->exec();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue