From b68a9df076a5f821b1a1b49207fad9ec9ac8a251 Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Mon, 3 Jun 2019 13:40:01 +0200 Subject: 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 --- src/corelib/kernel/qcoreapplication.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/corelib/kernel/qcoreapplication.cpp') 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: -- cgit v1.2.3