Skip to content

Commit

Permalink
[4.4.3] added connect to QQuickWindow::sceneGraphError
Browse files Browse the repository at this point in the history
  • Loading branch information
igorkorsukov committed Oct 15, 2024
1 parent 864350f commit b5dc3c9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/app/internal/guiapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,16 @@ void GuiApp::perform()
const QUrl url(QStringLiteral("qrc:/qml") + mainQmlFile);
#endif

QObject::connect(engine, &QQmlApplicationEngine::objectCreated, qApp, [](QObject* obj, const QUrl&) {
QQuickWindow* w = dynamic_cast<QQuickWindow*>(obj);
//! NOTE It is important that there is a connection to this signal with an error,
//! otherwise the default action will be performed - displaying a message and terminating.
//! We will not be able to switch to another backend.
QObject::connect(w, &QQuickWindow::sceneGraphError, qApp, [](QQuickWindow::SceneGraphError, const QString& msg) {
LOGE() << "scene graph error: " << msg;
});
}, Qt::DirectConnection);

QObject::connect(engine, &QQmlApplicationEngine::objectCreated, qApp,
[this, url, splashScreen](QObject* obj, const QUrl& objUrl) {
if (!obj && url == objUrl) {
Expand Down

0 comments on commit b5dc3c9

Please sign in to comment.