diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2019-01-14 15:51:24 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2019-01-15 20:05:11 +0000 |
commit | 5050a6e9cd80dee723b62bba8160ffe7b0ec6b01 (patch) | |
tree | d1ceb96eab98d8eb414859a31dfc31582d076c36 /tools/qml/main.cpp | |
parent | 7d9d64b40718ace6ffa68e06808bcdf1a3f5099b (diff) |
qml runtime: Don't assume there is a window, verify it
Change-Id: I83ea0f679170dfab6f99edb17950e27ca2aedfb1
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Diffstat (limited to 'tools/qml/main.cpp')
-rw-r--r-- | tools/qml/main.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
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) |