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 <volker.hilsheimer@qt.io>
This commit is contained in:
Eirik Aavitsland 2021-01-15 10:31:51 +01:00
parent c111aad270
commit 96e9c8cc8a

View File

@ -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;