diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/graphicsview/qgraphicswidget.cpp | 4 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicswidget_p.cpp | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/graphicsview/qgraphicswidget.cpp b/src/gui/graphicsview/qgraphicswidget.cpp index 0fabd18..1bfe266 100644 --- a/src/gui/graphicsview/qgraphicswidget.cpp +++ b/src/gui/graphicsview/qgraphicswidget.cpp @@ -937,7 +937,9 @@ void QGraphicsWidget::setStyle(QStyle *style) QFont QGraphicsWidget::font() const { Q_D(const QGraphicsWidget); - return d->font; + QFont fnt = d->font; + fnt.resolve(fnt.resolve() | d->inheritedFontResolveMask); + return fnt; } void QGraphicsWidget::setFont(const QFont &font) { diff --git a/src/gui/graphicsview/qgraphicswidget_p.cpp b/src/gui/graphicsview/qgraphicswidget_p.cpp index f7850ca..3466733 100644 --- a/src/gui/graphicsview/qgraphicswidget_p.cpp +++ b/src/gui/graphicsview/qgraphicswidget_p.cpp @@ -254,7 +254,10 @@ void QGraphicsWidgetPrivate::setFont_helper(const QFont &font) void QGraphicsWidgetPrivate::resolveFont(uint inheritedMask) { + Q_Q(QGraphicsWidget); inheritedFontResolveMask = inheritedMask; + if (QGraphicsWidget *p = q->parentWidget()) + inheritedFontResolveMask |= p->d_func()->inheritedFontResolveMask; QFont naturalFont = naturalWidgetFont(); QFont resolvedFont = font.resolve(naturalFont); updateFont(resolvedFont); |