diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-11-24 12:28:40 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-12-08 22:59:08 +0100 |
commit | 35d62b6852c836eb3cd9f7d5f5b9412b08823288 (patch) | |
tree | f8db6e018eed884616c062b90f5ad6221469e347 /src/gui | |
parent | 5f43d665d803b52f66d8763efb736db75fd11228 (diff) |
Get rid of QPenPrivate::defaultWidth
It is no longer used.
Change-Id: I834e0cbd6ef4fefb52d0864053e95e7dea19b389
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/painting/qpen.cpp | 21 | ||||
-rw-r--r-- | src/gui/painting/qpen_p.h | 3 |
2 files changed, 8 insertions, 16 deletions
diff --git a/src/gui/painting/qpen.cpp b/src/gui/painting/qpen.cpp index 70d56297cb..229384587e 100644 --- a/src/gui/painting/qpen.cpp +++ b/src/gui/painting/qpen.cpp @@ -227,10 +227,10 @@ typedef QPenPrivate QPenData; /*! \internal */ -inline QPenPrivate::QPenPrivate(const QBrush &_brush, qreal _width, Qt::PenStyle penStyle, - Qt::PenCapStyle _capStyle, Qt::PenJoinStyle _joinStyle, bool _defaultWidth) +QPenPrivate::QPenPrivate(const QBrush &_brush, qreal _width, Qt::PenStyle penStyle, + Qt::PenCapStyle _capStyle, Qt::PenJoinStyle _joinStyle) : ref(1), dashOffset(0), miterLimit(2), - cosmetic(false), defaultWidth(_defaultWidth) + cosmetic(false) { width = _width; brush = _brush; @@ -313,7 +313,7 @@ QPen::QPen(const QColor &color) QPen::QPen(const QBrush &brush, qreal width, Qt::PenStyle s, Qt::PenCapStyle c, Qt::PenJoinStyle j) { - d = new QPenData(brush, width, s, c, j, false); + d = new QPenData(brush, width, s, c, j); } /*! @@ -661,7 +661,6 @@ void QPen::setWidth(int width) return; detach(); d->width = width; - d->defaultWidth = false; } /*! @@ -688,7 +687,6 @@ void QPen::setWidthF(qreal width) return; detach(); d->width = width; - d->defaultWidth = false; } @@ -875,8 +873,7 @@ bool QPen::operator==(const QPen &p) const || (qFuzzyCompare(pdd->dashOffset, dd->dashOffset) && pdd->dashPattern == dd->dashPattern)) && p.d->brush == d->brush - && pdd->cosmetic == dd->cosmetic - && pdd->defaultWidth == dd->defaultWidth); + && pdd->cosmetic == dd->cosmetic); } @@ -939,7 +936,7 @@ QDataStream &operator<<(QDataStream &s, const QPen &p) if (s.version() >= 9) s << double(p.dashOffset()); if (s.version() >= QDataStream::Qt_5_0) - s << bool(dd->defaultWidth); + s << bool(qFuzzyIsNull(p.widthF())); } return s; } @@ -965,7 +962,7 @@ QDataStream &operator>>(QDataStream &s, QPen &p) QList<qreal> dashPattern; double dashOffset = 0; bool cosmetic = false; - bool defaultWidth = false; + bool defaultWidth; if (s.version() < QDataStream::Qt_4_3) { quint8 style8; s >> style8; @@ -1001,9 +998,6 @@ QDataStream &operator>>(QDataStream &s, QPen &p) if (s.version() >= QDataStream::Qt_5_0) { s >> defaultWidth; - } else { - // best we can do for legacy pens - defaultWidth = qFuzzyIsNull(width); } p.detach(); @@ -1017,7 +1011,6 @@ QDataStream &operator>>(QDataStream &s, QPen &p) dd->miterLimit = miterLimit; dd->dashOffset = dashOffset; dd->cosmetic = cosmetic; - dd->defaultWidth = defaultWidth; return s; } diff --git a/src/gui/painting/qpen_p.h b/src/gui/painting/qpen_p.h index 0cf05c7aec..e86b72a6e6 100644 --- a/src/gui/painting/qpen_p.h +++ b/src/gui/painting/qpen_p.h @@ -58,7 +58,7 @@ QT_BEGIN_NAMESPACE class QPenPrivate { public: QPenPrivate(const QBrush &brush, qreal width, Qt::PenStyle, Qt::PenCapStyle, - Qt::PenJoinStyle _joinStyle, bool defaultWidth = true); + Qt::PenJoinStyle _joinStyle); QAtomicInt ref; qreal width; QBrush brush; @@ -69,7 +69,6 @@ public: qreal dashOffset; qreal miterLimit; uint cosmetic : 1; - uint defaultWidth : 1; // default-constructed width? used for cosmetic pen compatibility }; QT_END_NAMESPACE |