From 860bfc69e44c6b8d3cd0263c5afc729292aa639d Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Sat, 26 Jan 2019 13:11:41 +0100 Subject: 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 --- src/gui/painting/qpainterpath.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/gui/painting/qpainterpath.cpp') 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 -- cgit v1.2.3