summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2017-12-07 11:56:58 +0100
committerAndy Shaw <andy.shaw@qt.io>2018-01-16 05:08:04 +0000
commitcb714248a87ddbdb080c11176d7c7693c0a979db (patch)
treecf70b5c396c75c0ba025bd39be4fb2b56d2559af /src/widgets/styles
parentf0cad9b612d0bc9d11819960f85c2f99c3dbebde (diff)
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>
Diffstat (limited to 'src/widgets/styles')
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp
index e8b90b87b3..8ff8ab65a6 100644
--- a/src/widgets/styles/qstylesheetstyle.cpp
+++ b/src/widgets/styles/qstylesheetstyle.cpp
@@ -3647,6 +3647,8 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q
QFont oldFont = p->font();
if (subRule.hasFont)
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
// items are styled in an incompatible way, such as having a background image.
@@ -3763,8 +3765,7 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q
}
}
- if (subRule.hasFont)
- p->setFont(oldFont);
+ p->setFont(oldFont);
return;
}