Fix bogus setAttribute setter warning

Since e9e16c7464 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>
This commit is contained in:
Michal Klocek 2019-06-03 13:40:01 +02:00 committed by Kai Koehne
parent f344b6357e
commit b68a9df076

View File

@ -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: