diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-07-12 17:39:13 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-07-12 17:39:13 -0700 |
commit | 15de7f0b716b4e3c28fee4f4ccbac4788a8d84b1 (patch) | |
tree | 713cf409f07a3c616508a20a29d570daa790487f /qt-gui.cpp | |
parent | 16759715e62a48ca3bb77a668a27103a6b90ea20 (diff) | |
download | subsurface-15de7f0b716b4e3c28fee4f4ccbac4788a8d84b1.tar.gz |
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>
Diffstat (limited to 'qt-gui.cpp')
-rw-r--r-- | qt-gui.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/qt-gui.cpp b/qt-gui.cpp index 1bd0e65ac..175e9c27d 100644 --- a/qt-gui.cpp +++ b/qt-gui.cpp @@ -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); |