From 34f39c8f0dd51f1f62c1d15e6cb466bcc2a7fa90 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 28 Jul 2015 13:07:29 +0200 Subject: [PATCH] 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 --- examples/quick/shared/shared.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/quick/shared/shared.h b/examples/quick/shared/shared.h index 4472b9bfb..d8fb80b97 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")) {\ -- 2.34.1