summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles/qstylesheetstyle.cpp
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-03-24 16:10:15 +0100
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2014-03-24 16:10:15 +0100
commit3b5c0bc0780f1749fed7c07bd8b691400a0282b7 (patch)
tree1022f5553ad5a0aca9b5f3b49ca38a01c2329d20 /src/widgets/styles/qstylesheetstyle.cpp
parentc79918733a194ebbe5a2fe1617c884659f3e4b9f (diff)
parent21f1738a94fc8544ece04b3b1ee03a11986fe59b (diff)
Merge remote-tracking branch 'origin/stable' into dev
Conflicts: src/gui/image/qjpeghandler.cpp Change-Id: I9db3acea7d5c82f5da679c8eaeb29431136665f0
Diffstat (limited to 'src/widgets/styles/qstylesheetstyle.cpp')
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp
index 711b0f579d..5eea903773 100644
--- a/src/widgets/styles/qstylesheetstyle.cpp
+++ b/src/widgets/styles/qstylesheetstyle.cpp
@@ -3383,6 +3383,11 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q
if (const QStyleOptionButton *button = qstyleoption_cast<const QStyleOptionButton *>(opt)) {
QStyleOptionButton butOpt(*button);
rule.configurePalette(&butOpt.palette, QPalette::ButtonText, QPalette::Button);
+
+ const QFont oldFont = p->font();
+ if (rule.hasFont)
+ p->setFont(rule.font);
+
if (rule.hasPosition() && rule.position()->textAlignment != 0) {
Qt::Alignment textAlignment = rule.position()->textAlignment;
QRect textRect = button->rect;
@@ -3455,6 +3460,9 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q
} else {
ParentStyle::drawControl(ce, &butOpt, p, w);
}
+
+ if (rule.hasFont)
+ p->setFont(oldFont);
}
return;