diff options
Diffstat (limited to 'src/qml/qml/qqmlapplicationengine.cpp')
-rw-r--r-- | src/qml/qml/qqmlapplicationengine.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/qml/qml/qqmlapplicationengine.cpp b/src/qml/qml/qqmlapplicationengine.cpp index e2d9dceb16..82cc335c8e 100644 --- a/src/qml/qml/qqmlapplicationengine.cpp +++ b/src/qml/qml/qqmlapplicationengine.cpp @@ -257,10 +257,9 @@ void QQmlApplicationEnginePrivate::ensureLoadingFinishes(QQmlComponent *c) QGuiApplication app(argc, argv); QQmlApplicationEngine engine; - // quit on error - QObject::connect(&engine, QQmlApplicationEngine::objectCreationFailed, - QCoreApplication::instance(), QCoreApplication::quit, - Qt::QueuedConnection); + // exit on error + QObject::connect(&engine, &QQmlApplicationEngine::objectCreationFailed, + &app, []() { QCoreApplication::exit(-1); }, Qt::QueuedConnection); engine.load(QUrl()); return app.exec(); \endcode |