diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2016-02-25 09:18:04 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2016-02-25 08:27:03 +0000 |
commit | f8f1ddfd1258d224afea6c9774e60f76e294032e (patch) | |
tree | d51c7b877169221983ee2d8ad6f84063c94ba617 /examples/scxml/mediaplayer-qml-static | |
parent | f4aee241f46aefe6bc775a1d0fc061ff6d088c57 (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/mediaplayer-qml-static')
-rw-r--r-- | examples/scxml/mediaplayer-qml-static/mediaplayer-qml-static.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/examples/scxml/mediaplayer-qml-static/mediaplayer-qml-static.cpp b/examples/scxml/mediaplayer-qml-static/mediaplayer-qml-static.cpp index c6d9d3a..9aa1ea3 100644 --- a/examples/scxml/mediaplayer-qml-static/mediaplayer-qml-static.cpp +++ b/examples/scxml/mediaplayer-qml-static/mediaplayer-qml-static.cpp @@ -65,6 +65,8 @@ int main(int argc, char *argv[]) QQmlApplicationEngine engine; engine.rootContext()->setContextProperty(QStringLiteral("mediaPlayerStateMachine"), &stateMachine); engine.load(QUrl(QStringLiteral("qrc:///mediaplayer-qml-static.qml"))); + if (engine.rootObjects().isEmpty()) + return -1; return app.exec(); } |