Use font set in the style option if there is no font set in the rule
If the stylesheet does not have a rule that manipulates the font at all for the menu item, then it should use the one passed into the style option instead. Task-number: QTBUG-65034 Change-Id: I6cae3fad3cc22d5ab2b984e4a58b14303bcd6d03 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
This commit is contained in:
parent
f0cad9b612
commit
cb714248a8
@ -3647,6 +3647,8 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q
|
|||||||
QFont oldFont = p->font();
|
QFont oldFont = p->font();
|
||||||
if (subRule.hasFont)
|
if (subRule.hasFont)
|
||||||
p->setFont(subRule.font.resolve(p->font()));
|
p->setFont(subRule.font.resolve(p->font()));
|
||||||
|
else
|
||||||
|
p->setFont(mi.font);
|
||||||
|
|
||||||
// We fall back to drawing with the style sheet code whenever at least one of the
|
// We fall back to drawing with the style sheet code whenever at least one of the
|
||||||
// items are styled in an incompatible way, such as having a background image.
|
// items are styled in an incompatible way, such as having a background image.
|
||||||
@ -3763,7 +3765,6 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (subRule.hasFont)
|
|
||||||
p->setFont(oldFont);
|
p->setFont(oldFont);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user