From 12de7f8387c5ccc17a3212094a3d540f1f0f1658 Mon Sep 17 00:00:00 2001 From: Mohammed Sameer Date: Wed, 31 Jul 2013 21:02:56 +0300 Subject: [PATCH] Qt5: If QQuickView cannot load QML then print them and quit. --- src/main.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 0ddd0fd..0fc23bd 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -28,6 +28,7 @@ #elif defined(QT5) #include #include +#include #endif #include "settings.h" @@ -135,7 +136,23 @@ Q_DECL_EXPORT int main(int argc, char *argv[]) { view->setSource(QUrl("qrc:/qml/main.qml")); +#if defined(QT5) view->showFullScreen(); + if (view->status() == QQuickView::Error) { + qCritical() << "Errors loading QML:"; + QList errors = view->errors(); + + foreach (const QQmlError& error, errors) { + qCritical() << error.toString(); + } + + delete view; + delete app; + + return 1; + } + +#endif int ret = app->exec(); -- 2.25.1