mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
QML UI: implement a message area to show information to the user
This is just a quick first stab to do this, but it at least allows us to share some information with the user. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
16759715e6
commit
15de7f0b71
4 changed files with 49 additions and 3 deletions
|
@ -45,9 +45,14 @@ void run_ui()
|
|||
QQmlContext *ctxt = engine.rootContext();
|
||||
ctxt->setContextProperty("diveModel", &diveListModel);
|
||||
engine.load(QUrl(QStringLiteral("qrc:///qml/main.qml")));
|
||||
QObject *mainWindow = engine.rootObjects().value(0);
|
||||
QQuickWindow *qml_window = qobject_cast<QQuickWindow *>(mainWindow);
|
||||
qqWindowObject = engine.rootObjects().value(0);
|
||||
if (!qqWindowObject) {
|
||||
fprintf(stderr, "can't create window object\n");
|
||||
exit(1);
|
||||
}
|
||||
QQuickWindow *qml_window = qobject_cast<QQuickWindow *>(qqWindowObject);
|
||||
qml_window->setIcon(QIcon(":/subsurface-mobile-icon"));
|
||||
qqWindowObject->setProperty("messageText", QVariant("Subsurface mobile startup"));
|
||||
#if !defined(Q_OS_ANDROID)
|
||||
qml_window->setHeight(1200);
|
||||
qml_window->setWidth(800);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue