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:
Dirk Hohndel 2015-07-12 17:39:13 -07:00
parent 16759715e6
commit 15de7f0b71
4 changed files with 49 additions and 3 deletions

View file

@ -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);