diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2015-11-17 07:14:01 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2015-11-17 07:14:16 +0100 |
commit | 17dc773221c402308ddf15bcdb622b00ab7a95c3 (patch) | |
tree | 2e0b5a076b6b51e5fb77aec0ce379227ef681f3d /src/widgets/kernel | |
parent | 99d061ffd5ea9fc52d96b92cdf3dce93685b4205 (diff) | |
parent | 9daef8a54c32162a50b0f558dac829333165618f (diff) |
Merge remote-tracking branch 'origin/5.5' into 5.6
Change-Id: I6b1fe0c6c360a0d5285911869f0f4f93d86d822e
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r-- | src/widgets/kernel/qwidget.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 029f0f3425..4037310088 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -4700,9 +4700,11 @@ QFont QWidgetPrivate::naturalWidgetFont(uint inheritedMask) const if (QWidget *p = q->parentWidget()) { if (!p->testAttribute(Qt::WA_StyleSheet)) { if (!naturalFont.isCopyOf(QApplication::font())) { - QFont inheritedFont = p->font(); - inheritedFont.resolve(inheritedMask); - naturalFont = inheritedFont.resolve(naturalFont); + if (inheritedMask != 0) { + QFont inheritedFont = p->font(); + inheritedFont.resolve(inheritedMask); + naturalFont = inheritedFont.resolve(naturalFont); + } // else nothing to do (naturalFont = naturalFont) } else { naturalFont = p->font(); } @@ -4710,9 +4712,11 @@ QFont QWidgetPrivate::naturalWidgetFont(uint inheritedMask) const } #ifndef QT_NO_GRAPHICSVIEW else if (extra && extra->proxyWidget) { - QFont inheritedFont = extra->proxyWidget->font(); - inheritedFont.resolve(inheritedMask); - naturalFont = inheritedFont.resolve(naturalFont); + if (inheritedMask != 0) { + QFont inheritedFont = extra->proxyWidget->font(); + inheritedFont.resolve(inheritedMask); + naturalFont = inheritedFont.resolve(naturalFont); + } // else nothing to do (naturalFont = naturalFont) } #endif //QT_NO_GRAPHICSVIEW } |