Fix shared example header.
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Tue, 28 Jul 2015 11:07:29 +0000 (13:07 +0200)
committerSimon Hausmann <simon.hausmann@theqtcompany.com>
Mon, 3 Aug 2015 08:49:15 +0000 (08:49 +0000)
Use new connection syntax and return -1 on load failures, which
avoids hanging processes and empty windows in case some module is not
installed.

Change-Id: I4966c9657b752eee8612fa893a0489bc8a64ccfc
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
examples/quick/shared/shared.h

index 4472b9bfbb105045e0c35b33b806ad3c454e9885..d8fb80b97efebede12a5587f48eeb58f41a14958 100644 (file)
         f.setVersion(4, 4);\
         view.setFormat(f);\
     }\
-    view.connect(view.engine(), SIGNAL(quit()), &app, SLOT(quit()));\
+    view.connect(view.engine(), &QQmlEngine::quit, &app, &QCoreApplication::quit);\
     new QQmlFileSelector(view.engine(), &view);\
     view.setSource(QUrl("qrc:///" #NAME ".qml")); \
+    if (view.status() == QQuickView::Error)\
+        return -1;\
     view.setResizeMode(QQuickView::SizeRootObjectToView);\
     if (QGuiApplication::platformName() == QLatin1String("qnx") || \
           QGuiApplication::platformName() == QLatin1String("eglfs")) {\