summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2018-04-26 09:55:10 +0200
committerLiang Qi <liang.qi@qt.io>2018-04-26 09:55:10 +0200
commit866b47916dfcf2823b8fc4df719f1ebf15acef70 (patch)
treea4eef09d00d407dec26b99b9f094bf1f5093dcb8 /src/widgets/styles
parenta9fc91466c2c143bea422d98af24755f43c2b97b (diff)
parent4bab1b0d7c2462ee9c5369c949b45bc4dedc1194 (diff)
Merge remote-tracking branch 'origin/5.11' into dev
Conflicts: src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm src/plugins/platforms/cocoa/qcocoawindow.mm Change-Id: Ideea96d1b43d47b1d9b34e11c9986a88e240aa71
Diffstat (limited to 'src/widgets/styles')
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp
index 8ba6504f87..98f2b8df2d 100644
--- a/src/widgets/styles/qstylesheetstyle.cpp
+++ b/src/widgets/styles/qstylesheetstyle.cpp
@@ -3850,7 +3850,7 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q
if(hasStyleRule(w, PseudoElement_HeaderViewSection)) {
QRenderRule subRule = renderRule(w, opt, PseudoElement_HeaderViewSection);
if (!subRule.hasNativeBorder() || !subRule.baseStyleCanDraw()
- || subRule.hasBackground() || subRule.hasPalette()) {
+ || subRule.hasBackground() || subRule.hasPalette() || subRule.hasFont) {
ParentStyle::drawControl(ce, opt, p, w);
return;
}
@@ -3887,12 +3887,14 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q
QStyleOptionHeader hdr(*header);
QRenderRule subRule = renderRule(w, opt, PseudoElement_HeaderViewSection);
subRule.configurePalette(&hdr.palette, QPalette::ButtonText, QPalette::Button);
- QFont oldFont = p->font();
- if (subRule.hasFont)
+ if (subRule.hasFont) {
+ QFont oldFont = p->font();
p->setFont(subRule.font.resolve(p->font()));
- baseStyle()->drawControl(ce, &hdr, p, w);
- if (subRule.hasFont)
+ ParentStyle::drawControl(ce, &hdr, p, w);
p->setFont(oldFont);
+ } else {
+ baseStyle()->drawControl(ce, &hdr, p, w);
+ }
return;
}
break;