summaryrefslogtreecommitdiffstats
path: root/examples/scxml/invoke-static
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2016-02-25 09:18:04 +0100
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2016-02-25 08:27:03 +0000
commitf8f1ddfd1258d224afea6c9774e60f76e294032e (patch)
treed51c7b877169221983ee2d8ad6f84063c94ba617 /examples/scxml/invoke-static
parentf4aee241f46aefe6bc775a1d0fc061ff6d088c57 (diff)
Examples: Return on QML load error.
Prevents hanging processes should an error while loading QML occur. Change-Id: I35f68ef170755f075fe95e2e535e363a49c598ee Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
Diffstat (limited to 'examples/scxml/invoke-static')
-rw-r--r--examples/scxml/invoke-static/invoke-static.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/examples/scxml/invoke-static/invoke-static.cpp b/examples/scxml/invoke-static/invoke-static.cpp
index c6d0655..c955ebe 100644
--- a/examples/scxml/invoke-static/invoke-static.cpp
+++ b/examples/scxml/invoke-static/invoke-static.cpp
@@ -63,6 +63,9 @@ int main(int argc, char *argv[])
QQmlApplicationEngine engine;
engine.rootContext()->setContextProperty(QStringLiteral("directions"), &stateMachine);
engine.load(QUrl(QStringLiteral("qrc:/invoke-static.qml")));
+ if (engine.rootObjects().isEmpty())
+ return -1;
+
stateMachine.start();
return app.exec();