mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +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 <QDesktopWidget>
|
||||||
#include <QNetworkProxy>
|
#include <QNetworkProxy>
|
||||||
#include <QLibraryInfo>
|
#include <QLibraryInfo>
|
||||||
#include <QTextCodec>
|
|
||||||
|
#include <QQuickWindow>
|
||||||
|
#include <QQmlApplicationEngine>
|
||||||
|
|
||||||
#include "qt-gui.h"
|
#include "qt-gui.h"
|
||||||
|
|
||||||
|
@ -28,7 +30,15 @@ void init_ui()
|
||||||
|
|
||||||
void run_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();
|
window->show();
|
||||||
|
#endif
|
||||||
qApp->exec();
|
qApp->exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue