diff options
Diffstat (limited to 'src/widgets/styles/qstylesheetstyle.cpp')
-rw-r--r-- | src/widgets/styles/qstylesheetstyle.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp index fd812d8d0d..4e4576940a 100644 --- a/src/widgets/styles/qstylesheetstyle.cpp +++ b/src/widgets/styles/qstylesheetstyle.cpp @@ -833,7 +833,7 @@ QHash<QStyle::SubControl, QRect> QStyleSheetStyle::titleBarLayout(const QWidget continue; } if (info.element == PseudoElement_TitleBar) { - info.width = tb->fontMetrics.width(tb->text) + 6; + info.width = tb->fontMetrics.horizontalAdvance(tb->text) + 6; subRule.geo = new QStyleSheetGeometryData(info.width, tb->fontMetrics.height(), -1, -1, -1, -1); } else { subRule = renderRule(w, tb, info.element); @@ -5485,7 +5485,7 @@ QRect QStyleSheetStyle::subControlRect(ComplexControl cc, const QStyleOptionComp groupBox.rect = rule.borderRect(opt->rect); return baseStyle()->subControlRect(cc, &groupBox, sc, w); } - int tw = opt->fontMetrics.width(gb->text); + int tw = opt->fontMetrics.horizontalAdvance(gb->text); int th = opt->fontMetrics.height(); int spacing = pixelMetric(QStyle::PM_CheckBoxLabelSpacing, opt, w); int iw = pixelMetric(QStyle::PM_IndicatorWidth, opt, w); |