diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2019-01-26 13:11:41 +0100 |
---|---|---|
committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2019-02-02 12:49:34 +0000 |
commit | 860bfc69e44c6b8d3cd0263c5afc729292aa639d (patch) | |
tree | 657eeec0db2cf7d82151224b11fc6c2aafcc4d88 | |
parent | e56401818b1aae9856a5334f530c4eda33788429 (diff) | |
download | qtbase-860bfc69e44c6b8d3cd0263c5afc729292aa639d.tar.gz |
QtGui/QPainterPath: mark obsolete functions as deprecated
Mark some long obsolete functions as deprecated so the can be removed
with Qt6:
- addRoundRect()
- subtractedInverted()
Change-Id: I4707c07e983a4ac65ec3706d25b09ec01a9de62c
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
-rw-r--r-- | src/gui/painting/qpainterpath.cpp | 25 | ||||
-rw-r--r-- | src/gui/painting/qpainterpath.h | 43 |
2 files changed, 39 insertions, 29 deletions
diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp index 3687bcf7d0..cb8bb9dfcf 100644 --- a/src/gui/painting/qpainterpath.cpp +++ b/src/gui/painting/qpainterpath.cpp @@ -3242,6 +3242,7 @@ void QPainterPath::addRoundedRect(const QRectF &rect, qreal xRadius, qreal yRadi Adds the given rectangle \a x, \a y, \a w, \a h with rounded corners to the path. */ +#if QT_DEPRECATED_SINCE(5, 13) /*! \obsolete @@ -3308,6 +3309,17 @@ void QPainterPath::addRoundRect(const QRectF &r, int xRnd, int yRnd) \sa addRoundedRect() */ +void QPainterPath::addRoundRect(const QRectF &rect, + int roundness) +{ + int xRnd = roundness; + int yRnd = roundness; + if (rect.width() > rect.height()) + xRnd = int(roundness * rect.height()/rect.width()); + else + yRnd = int(roundness * rect.width()/rect.height()); + addRoundRect(rect, xRnd, yRnd); +} /*! \obsolete @@ -3324,6 +3336,11 @@ void QPainterPath::addRoundRect(const QRectF &r, int xRnd, int yRnd) \sa addRoundedRect() */ +void QPainterPath::addRoundRect(qreal x, qreal y, qreal w, qreal h, + int xRnd, int yRnd) +{ + addRoundRect(QRectF(x, y, w, h), xRnd, yRnd); +} /*! \obsolete @@ -3343,6 +3360,12 @@ void QPainterPath::addRoundRect(const QRectF &r, int xRnd, int yRnd) \sa addRoundedRect() */ +void QPainterPath::addRoundRect(qreal x, qreal y, qreal w, qreal h, + int roundness) +{ + addRoundRect(QRectF(x, y, w, h), roundness); +} +#endif /*! \since 4.3 @@ -3397,6 +3420,7 @@ QPainterPath QPainterPath::subtracted(const QPainterPath &p) const return clipper.clip(QPathClipper::BoolSub); } +#if QT_DEPRECATED_SINCE(5, 13) /*! \since 4.3 \obsolete @@ -3409,6 +3433,7 @@ QPainterPath QPainterPath::subtractedInverted(const QPainterPath &p) const { return p.subtracted(*this); } +#endif /*! \since 4.4 diff --git a/src/gui/painting/qpainterpath.h b/src/gui/painting/qpainterpath.h index 770b8f48d0..a69a192767 100644 --- a/src/gui/painting/qpainterpath.h +++ b/src/gui/painting/qpainterpath.h @@ -143,12 +143,18 @@ public: qreal xRadius, qreal yRadius, Qt::SizeMode mode = Qt::AbsoluteSize); +#if QT_DEPRECATED_SINCE(5, 13) + QT_DEPRECATED_X("Use addRoundedRect(..., Qt::RelativeSize) instead") void addRoundRect(const QRectF &rect, int xRnd, int yRnd); - inline void addRoundRect(qreal x, qreal y, qreal w, qreal h, - int xRnd, int yRnd); - inline void addRoundRect(const QRectF &rect, int roundness); - inline void addRoundRect(qreal x, qreal y, qreal w, qreal h, - int roundness); + QT_DEPRECATED_X("Use addRoundedRect(..., Qt::RelativeSize) instead") + void addRoundRect(qreal x, qreal y, qreal w, qreal h, + int xRnd, int yRnd); + QT_DEPRECATED_X("Use addRoundedRect(..., Qt::RelativeSize) instead") + void addRoundRect(const QRectF &rect, int roundness); + QT_DEPRECATED_X("Use addRoundedRect(..., Qt::RelativeSize) instead") + void addRoundRect(qreal x, qreal y, qreal w, qreal h, + int roundness); +#endif void connectPath(const QPainterPath &path); @@ -193,7 +199,10 @@ public: Q_REQUIRED_RESULT QPainterPath united(const QPainterPath &r) const; Q_REQUIRED_RESULT QPainterPath intersected(const QPainterPath &r) const; Q_REQUIRED_RESULT QPainterPath subtracted(const QPainterPath &r) const; +#if QT_DEPRECATED_SINCE(5, 13) + QT_DEPRECATED_X("Use r.subtracted() instead") Q_REQUIRED_RESULT QPainterPath subtractedInverted(const QPainterPath &r) const; +#endif Q_REQUIRED_RESULT QPainterPath simplified() const; @@ -338,30 +347,6 @@ inline void QPainterPath::addRoundedRect(qreal x, qreal y, qreal w, qreal h, addRoundedRect(QRectF(x, y, w, h), xRadius, yRadius, mode); } -inline void QPainterPath::addRoundRect(qreal x, qreal y, qreal w, qreal h, - int xRnd, int yRnd) -{ - addRoundRect(QRectF(x, y, w, h), xRnd, yRnd); -} - -inline void QPainterPath::addRoundRect(const QRectF &rect, - int roundness) -{ - int xRnd = roundness; - int yRnd = roundness; - if (rect.width() > rect.height()) - xRnd = int(roundness * rect.height()/rect.width()); - else - yRnd = int(roundness * rect.width()/rect.height()); - addRoundRect(rect, xRnd, yRnd); -} - -inline void QPainterPath::addRoundRect(qreal x, qreal y, qreal w, qreal h, - int roundness) -{ - addRoundRect(QRectF(x, y, w, h), roundness); -} - inline void QPainterPath::addText(qreal x, qreal y, const QFont &f, const QString &text) { addText(QPointF(x, y), f, text); |