From 96e9c8cc8aae718942f79ac98e775f06501b0e25 Mon Sep 17 00:00:00 2001 From: Eirik Aavitsland Date: Fri, 15 Jan 2021 10:31:51 +0100 Subject: Correct item indent in checkable menus in stylesheet style Not only the checkable items need to be indented, but all items in the same menu, so that they line up. Pick-to: 6.0 5.15 Fixes: QTBUG-90242 Change-Id: I559005f753b5cd19eaeeeb6658178d62de93b4ef Reviewed-by: Volker Hilsheimer --- src/widgets/styles/qstylesheetstyle.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp index e7662ba5c6..a200cc0cd1 100644 --- a/src/widgets/styles/qstylesheetstyle.cpp +++ b/src/widgets/styles/qstylesheetstyle.cpp @@ -3789,10 +3789,10 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q QRect pmr(0, 0, pixw, pixh); pmr.moveCenter(iconRect.center()); p->drawPixmap(pmr.topLeft(), pixmap); - } else if (checkable) { + } else if (mi.menuHasCheckableItems) { QRenderRule subSubRule = renderRule(w, opt, PseudoElement_MenuCheckMark); const QRect cmRect = positionRect(w, subRule, subSubRule, PseudoElement_MenuCheckMark, opt->rect, opt->direction); - if (subSubRule.hasDrawable() || checked) { + if (checkable && (subSubRule.hasDrawable() || checked)) { QStyleOptionMenuItem newMi = mi; if (!dis) newMi.state |= State_Enabled; -- cgit v1.2.3