diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-07-28 13:07:29 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-08-03 08:49:15 +0000 |
commit | 34f39c8f0dd51f1f62c1d15e6cb466bcc2a7fa90 (patch) | |
tree | ca461aa23aad434db6c817924773a874c5f926a6 /examples/quick | |
parent | 0538b70895e43b47b0d2368df42a3e11cffa1fe8 (diff) |
Fix shared example header.
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>
Diffstat (limited to 'examples/quick')
-rw-r--r-- | examples/quick/shared/shared.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/quick/shared/shared.h b/examples/quick/shared/shared.h index 4472b9bfbb..d8fb80b97e 100644 --- a/examples/quick/shared/shared.h +++ b/examples/quick/shared/shared.h @@ -55,9 +55,11 @@ 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")) {\ |