summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles/qstylesheetstyle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/styles/qstylesheetstyle.cpp')
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp
index 96c6fdf2e2..7c1c0ca3d8 100644
--- a/src/widgets/styles/qstylesheetstyle.cpp
+++ b/src/widgets/styles/qstylesheetstyle.cpp
@@ -2642,7 +2642,7 @@ void QStyleSheetStyle::setPalette(QWidget *w)
QRenderRule rule = renderRule(w, PseudoElement_None, map[i].state | extendedPseudoClass(w));
if (i == 0) {
if (!w->property("_q_styleSheetWidgetFont").isValid()) {
- saveWidgetFont(w, w->font());
+ saveWidgetFont(w, w->d_func()->localFont());
}
updateStyleSheetFont(w);
if (ew != w)
@@ -6025,7 +6025,7 @@ void QStyleSheetStyle::updateStyleSheetFont(QWidget* w) const
unsetStyleSheetFont(w);
if (rule.font.resolve()) {
- QFont wf = w->font();
+ QFont wf = w->d_func()->localFont();
styleSheetCaches->customFontWidgets.insert(w, {wf, rule.font.resolve()});
QFont font = rule.font.resolve(wf);
@@ -6033,7 +6033,9 @@ void QStyleSheetStyle::updateStyleSheetFont(QWidget* w) const
w->setFont(font);
}
} else {
- QFont font = rule.font.resolve(w->font());
+ QFont wf = w->d_func()->localFont();
+ QFont font = rule.font.resolve(wf);
+ font.resolve(wf.resolve() | rule.font.resolve());
if ((!w->isWindow() || w->testAttribute(Qt::WA_WindowPropagation))
&& isNaturalChild(w) && qobject_cast<QWidget *>(w->parent())) {
@@ -6041,10 +6043,11 @@ void QStyleSheetStyle::updateStyleSheetFont(QWidget* w) const
font = font.resolve(static_cast<QWidget *>(w->parent())->font());
}
- if (w->data->fnt == font)
+ if (wf.resolve() == font.resolve() && wf == font)
return;
w->data->fnt = font;
+ w->d_func()->directFontResolveMask = font.resolve();
QEvent e(QEvent::FontChange);
QApplication::sendEvent(w, &e);