aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoris Verria <doris.verria@qt.io>2026-09-17 12:21:15 +0200
committerDoris Verria <doris.verria@qt.io>2026-09-17 14:08:05 +0000
commit1a2d061ce8bd4301a029ef18aff7559b48aff28d (patch)
treea0cc8f3ea80404dea3feca799db6d54a5c743651
parent437d54573bdd968298b9595f8f1e27d6a7ec561c (diff)
QStyleKitStyle: Check for exact window type when determining type
For window types, in order to determine the matching StyleKit control type, we were checking if the respective bits were set (eg. Qt::Popup, Qt::Dialog, Qt::Window). However, Qt::Popup is 0x00000008 | Window, and so every other window type has the Window flag. So every window type was resolving to Qt::Popup being the first in order. This was causing the window background color to not be applied correctly as it was set to the popup background color. To fix, check for exact window type instead. Pick-to: 6.12 Change-Id: I58062f918b2e53fe10714e1a10460008787e81c7 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
-rw-r--r--src/labs/stylekit/widgets/qstylekitstyle.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/labs/stylekit/widgets/qstylekitstyle.cpp b/src/labs/stylekit/widgets/qstylekitstyle.cpp
index f83b357de1..7cccff9970 100644
--- a/src/labs/stylekit/widgets/qstylekitstyle.cpp
+++ b/src/labs/stylekit/widgets/qstylekitstyle.cpp
@@ -410,11 +410,11 @@ static QQStyleKitReader::ControlType controlTypeForWidget(const QWidget *widget)
if (qobject_cast<const QMenu *>(widget))
return QQStyleKitReader::Menu;
#endif
- if (widget->windowType() & Qt::Popup)
+ if (widget->windowType() == Qt::Popup)
return QQStyleKitReader::Popup;
- if (widget->windowType() & Qt::Dialog)
+ if (widget->windowType() == Qt::Dialog)
return QQStyleKitReader::Dialog;
- if (widget->windowType() & Qt::Window)
+ if (widget->windowType() == Qt::Window)
return QQStyleKitReader::ApplicationWindow;
#ifndef QT_NO_FRAME
if (qobject_cast<const QFrame *>(widget))