diff options
Diffstat (limited to 'src/widgets/styles/qstylesheetstyle.cpp')
-rw-r--r-- | src/widgets/styles/qstylesheetstyle.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp index 494b28c909..14f81afe83 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); @@ -1463,7 +1463,7 @@ class QStyleSheetStyleSelector : public StyleSelector public: QStyleSheetStyleSelector() { } - QStringList nodeNames(NodePtr node) const Q_DECL_OVERRIDE + QStringList nodeNames(NodePtr node) const override { if (isNullNode(node)) return QStringList(); @@ -1479,7 +1479,7 @@ public: } while (metaObject != 0); return result; } - QString attribute(NodePtr node, const QString& name) const Q_DECL_OVERRIDE + QString attribute(NodePtr node, const QString& name) const override { if (isNullNode(node)) return QString(); @@ -1516,7 +1516,7 @@ public: cache[name] = valueStr; return valueStr; } - bool nodeNameEquals(NodePtr node, const QString& nodeName) const Q_DECL_OVERRIDE + bool nodeNameEquals(NodePtr node, const QString& nodeName) const override { if (isNullNode(node)) return false; @@ -1539,19 +1539,19 @@ public: } while (metaObject != 0); return false; } - bool hasAttributes(NodePtr) const Q_DECL_OVERRIDE + bool hasAttributes(NodePtr) const override { return true; } - QStringList nodeIds(NodePtr node) const Q_DECL_OVERRIDE + QStringList nodeIds(NodePtr node) const override { return isNullNode(node) ? QStringList() : QStringList(OBJECT_PTR(node)->objectName()); } - bool isNullNode(NodePtr node) const Q_DECL_OVERRIDE + bool isNullNode(NodePtr node) const override { return node.ptr == 0; } - NodePtr parentNode(NodePtr node) const Q_DECL_OVERRIDE + NodePtr parentNode(NodePtr node) const override { NodePtr n; n.ptr = isNullNode(node) ? 0 : parentObject(OBJECT_PTR(node)); return n; } - NodePtr previousSiblingNode(NodePtr) const Q_DECL_OVERRIDE + NodePtr previousSiblingNode(NodePtr) const override { NodePtr n; n.ptr = 0; return n; } - NodePtr duplicateNode(NodePtr node) const Q_DECL_OVERRIDE + NodePtr duplicateNode(NodePtr node) const override { return node; } - void freeNode(NodePtr) const Q_DECL_OVERRIDE + void freeNode(NodePtr) const override { } private: @@ -4262,7 +4262,7 @@ void QStyleSheetStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *op switch (pe) { case PE_FrameStatusBar: { - QRenderRule subRule = renderRule(w ? w->parentWidget() : Q_NULLPTR, opt, PseudoElement_Item); + QRenderRule subRule = renderRule(w ? w->parentWidget() : nullptr, opt, PseudoElement_Item); if (subRule.hasDrawable()) { subRule.drawRule(p, opt->rect); return; @@ -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); |