OSDN Git Service

install QWindowsStyle event filter only for progress bars
authorIvailo Monev <xakepa10@gmail.com>
Tue, 16 Mar 2021 08:08:47 +0000 (10:08 +0200)
committerIvailo Monev <xakepa10@gmail.com>
Tue, 16 Mar 2021 08:08:47 +0000 (10:08 +0200)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
src/gui/styles/qstylehelper.cpp
src/gui/styles/qwindowsstyle.cpp

index 3f9361a..f1377ae 100644 (file)
@@ -45,7 +45,7 @@ QString uniqueName(const QString &key, const QStyleOption *option, const QSize &
     if (const QStyleOptionSpinBox *spinBox = qstyleoption_cast<const QStyleOptionSpinBox *>(option)) {
         tmp = tmp + HexString<uint>(spinBox->buttonSymbols)
                   + HexString<uint>(spinBox->stepEnabled)
-                  + QLatin1Char(spinBox->frame ? '1' : '0'); ;
+                  + QLatin1Char(spinBox->frame ? '1' : '0');
     }
 #endif // QT_NO_SPINBOX
     return tmp;
index 86a4e48..055f770 100644 (file)
@@ -169,11 +169,9 @@ QWindowsStyle::QWindowsStyle(QWindowsStylePrivate &dd) : QCommonStyle(dd)
 /*! \reimp */
 void QWindowsStyle::polish(QApplication *app)
 {
+    Q_D(QWindowsStyle);
+
     QCommonStyle::polish(app);
-    QWindowsStylePrivate *d = d_func();
-    // We only need the overhead when shortcuts are sometimes hidden
-    if (!proxy()->styleHint(SH_UnderlineShortcut, 0) && app)
-        app->installEventFilter(this);
 
     d->activeCaptionColor = app->palette().highlight().color();
     d->activeGradientCaptionColor = app->palette().highlight() .color();