projects
/
harmattan
/
cameraplus
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5087a3c
)
Qt5: If QQuickView cannot load QML then print them and quit.
author
Mohammed Sameer
<msameer@foolab.org>
Wed, 31 Jul 2013 18:02:56 +0000
(21:02 +0300)
committer
Mohammed Sameer
<msameer@foolab.org>
Wed, 31 Jul 2013 18:02:56 +0000
(21:02 +0300)
src/main.cpp
patch
|
blob
|
history
diff --git
a/src/main.cpp
b/src/main.cpp
index
0ddd0fd
..
0fc23bd
100644
(file)
--- a/
src/main.cpp
+++ b/
src/main.cpp
@@
-28,6
+28,7
@@
#elif defined(QT5)
#include <QGuiApplication>
#include <QQuickView>
#elif defined(QT5)
#include <QGuiApplication>
#include <QQuickView>
+#include <QQmlError>
#endif
#include "settings.h"
#endif
#include "settings.h"
@@
-135,7
+136,23
@@
Q_DECL_EXPORT int main(int argc, char *argv[]) {
view->setSource(QUrl("qrc:/qml/main.qml"));
view->setSource(QUrl("qrc:/qml/main.qml"));
+#if defined(QT5)
view->showFullScreen();
view->showFullScreen();
+ if (view->status() == QQuickView::Error) {
+ qCritical() << "Errors loading QML:";
+ QList<QQmlError> errors = view->errors();
+
+ foreach (const QQmlError& error, errors) {
+ qCritical() << error.toString();
+ }
+
+ delete view;
+ delete app;
+
+ return 1;
+ }
+
+#endif
int ret = app->exec();
int ret = app->exec();