summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2019-06-03 13:40:01 +0200
committerKai Koehne <kai.koehne@qt.io>2019-06-19 08:42:35 +0000
commitb68a9df076a5f821b1a1b49207fad9ec9ac8a251 (patch)
tree51094cf972f36f07c668da6d7be8f2c5c10e7fef /src/corelib
parentf344b6357e751f54bcb003bc88c7fe15d616be7c (diff)
Fix bogus setAttribute setter warning
Since e9e16c74643 running webengine application you can get warning "Attribute Qt::AA_ShareOpenGLContexts must be set before QCoreApplication is created." WebEngine set shared open gl context on qt_call_pre_routines, so when QCoreApplicationPrivate init() runs. Fixes: QTBUG-76391 Change-Id: I5fc146ed70054b0c1597fe06615cea2d7a8969d8 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index 8652c45634..db6546028a 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -979,7 +979,11 @@ void QCoreApplication::setAttribute(Qt::ApplicationAttribute attribute, bool on)
QCoreApplicationPrivate::attribs |= 1 << attribute;
else
QCoreApplicationPrivate::attribs &= ~(1 << attribute);
+#if defined(QT_NO_QOBJECT)
if (Q_UNLIKELY(qApp)) {
+#else
+ if (Q_UNLIKELY(QCoreApplicationPrivate::is_app_running)) {
+#endif
switch (attribute) {
case Qt::AA_EnableHighDpiScaling:
case Qt::AA_DisableHighDpiScaling: