summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/styles/qstylesheetstyle.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp
index bbda15b..61fdbcf 100644
--- a/src/gui/styles/qstylesheetstyle.cpp
+++ b/src/gui/styles/qstylesheetstyle.cpp
@@ -3378,6 +3378,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;
@@ -3450,6 +3455,9 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q
} else {
ParentStyle::drawControl(ce, &butOpt, p, w);
}
+
+ if (rule.hasFont)
+ p->setFont(oldFont);
}
return;