summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2015-11-17 07:14:01 +0100
committerLiang Qi <liang.qi@theqtcompany.com>2015-11-17 07:14:16 +0100
commit17dc773221c402308ddf15bcdb622b00ab7a95c3 (patch)
tree2e0b5a076b6b51e5fb77aec0ce379227ef681f3d /src/widgets/kernel
parent99d061ffd5ea9fc52d96b92cdf3dce93685b4205 (diff)
parent9daef8a54c32162a50b0f558dac829333165618f (diff)
Merge remote-tracking branch 'origin/5.5' into 5.6
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r--src/widgets/kernel/qwidget.cpp16
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
}