summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2021-07-13 13:51:42 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2021-07-14 17:56:01 +0200
commit70e4a70265d6066ef04c7ed5700dadade72ef44c (patch)
treeea5bddc8b7a7984fcc2c7af2b2690224e5ebdcd7 /src/widgets/styles
parentc9db5eed5490f38af90014cb76c469b713e94fb6 (diff)
Respect style sheet rules for checked and selected menu items
With a stylesheet that defines a rule for checked:selected menu items, the rule was never rendered. Instead, the checked rule was used. The 'act' variable was initialized based on State_Selected being set, but that state flags was never set on the temporary QStyleOptionMenuItem used to render the PE_IndicatorMenuCheckMark. Note: QStyleSheetStyle falls back to QWindowsStyle for this draw path. Task-number: QTBUG-73966 Pick-to: 6.2 Change-Id: I3044dbe8f60f1896f79af1afdb26094971704616 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/widgets/styles')
-rw-r--r--src/widgets/styles/qwindowsstyle.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/styles/qwindowsstyle.cpp b/src/widgets/styles/qwindowsstyle.cpp
index e6198540a3..8c5b509eb5 100644
--- a/src/widgets/styles/qwindowsstyle.cpp
+++ b/src/widgets/styles/qwindowsstyle.cpp
@@ -1169,7 +1169,7 @@ void QWindowsStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPai
if (!dis)
newMi.state |= State_Enabled;
if (act)
- newMi.state |= State_On;
+ newMi.state |= State_On | State_Selected;
newMi.rect = visualRect(opt->direction, menuitem->rect, QRect(menuitem->rect.x() + QWindowsStylePrivate::windowsItemFrame,
menuitem->rect.y() + QWindowsStylePrivate::windowsItemFrame,
checkcol - 2 * QWindowsStylePrivate::windowsItemFrame,