From 15de7f0b716b4e3c28fee4f4ccbac4788a8d84b1 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sun, 12 Jul 2015 17:39:13 -0700 Subject: 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 --- qt-gui.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'qt-gui.cpp') 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(mainWindow); + qqWindowObject = engine.rootObjects().value(0); + if (!qqWindowObject) { + fprintf(stderr, "can't create window object\n"); + exit(1); + } + QQuickWindow *qml_window = qobject_cast(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); -- cgit v1.2.3-70-g09d2