diff options
Diffstat (limited to 'src/widgets/kernel/qapplication.cpp')
-rw-r--r-- | src/widgets/kernel/qapplication.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index 9b8677e6a8..815ae7fe33 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -1068,15 +1068,17 @@ QStyle *QApplication::style() if (!QApplicationPrivate::app_style) { // Compile-time search for default style // - QString style; + QStyle *&app_style = QApplicationPrivate::app_style; + if (!QApplicationPrivate::styleOverride.isEmpty()) { - style = QApplicationPrivate::styleOverride.toLower(); - } else { - style = QApplicationPrivate::desktopStyleKey(); + const QString style = QApplicationPrivate::styleOverride.toLower(); + app_style = QStyleFactory::create(style); + if (!app_style) + qWarning("QApplication: invalid style override passed, ignoring it."); } + if (!app_style) + app_style = QStyleFactory::create(QApplicationPrivate::desktopStyleKey()); - QStyle *&app_style = QApplicationPrivate::app_style; - app_style = QStyleFactory::create(style); if (!app_style) { const QStringList styles = QStyleFactory::keys(); for (const auto &style : styles) { @@ -3116,11 +3118,11 @@ bool QApplication::notify(QObject *receiver, QEvent *e) key->accept(); else key->ignore(); - res = d->notify_helper(receiver, e); QWidget *w = isWidget ? static_cast<QWidget *>(receiver) : 0; #ifndef QT_NO_GRAPHICSVIEW QGraphicsWidget *gw = isGraphicsWidget ? static_cast<QGraphicsWidget *>(receiver) : 0; #endif + res = d->notify_helper(receiver, e); if ((res && key->isAccepted()) /* |