From 5050a6e9cd80dee723b62bba8160ffe7b0ec6b01 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Mon, 14 Jan 2019 15:51:24 +0100 Subject: qml runtime: Don't assume there is a window, verify it Change-Id: I83ea0f679170dfab6f99edb17950e27ca2aedfb1 Reviewed-by: Thomas Hartmann --- tools/qml/main.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'tools') diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp index 409d227579..166c6aabdf 100644 --- a/tools/qml/main.cpp +++ b/tools/qml/main.cpp @@ -184,7 +184,6 @@ public Q_SLOTS: Q_UNUSED(url) if (o) { checkForWindow(o); - haveWindow = true; if (conf && qae) for (PartialScene *ps : qAsConst(conf->completers)) if (o->inherits(ps->itemType().toUtf8().constData())) @@ -240,9 +239,11 @@ void LoadWatcher::contain(QObject *o, const QUrl &containPath) void LoadWatcher::checkForWindow(QObject *o) { #if defined(QT_GUI_LIB) && QT_CONFIG(opengl) - if (verboseMode && o->isWindowType() && o->inherits("QQuickWindow")) { - connect(o, SIGNAL(openglContextCreated(QOpenGLContext*)), - this, SLOT(onOpenGlContextCreated(QOpenGLContext*))); + if (o->isWindowType() && o->inherits("QQuickWindow")) { + haveWindow = true; + if (verboseMode) + connect(o, SIGNAL(openglContextCreated(QOpenGLContext*)), + this, SLOT(onOpenGlContextCreated(QOpenGLContext*))); } #else Q_UNUSED(o) -- cgit v1.2.3