diff options
Diffstat (limited to 'src/gui/painting/qpainterpath.h')
-rw-r--r-- | src/gui/painting/qpainterpath.h | 48 |
1 files changed, 19 insertions, 29 deletions
diff --git a/src/gui/painting/qpainterpath.h b/src/gui/painting/qpainterpath.h index db39c1c5a0..a69a192767 100644 --- a/src/gui/painting/qpainterpath.h +++ b/src/gui/painting/qpainterpath.h @@ -97,8 +97,13 @@ public: { qSwap(d_ptr, other.d_ptr); return *this; } #endif ~QPainterPath(); + inline void swap(QPainterPath &other) Q_DECL_NOEXCEPT { d_ptr.swap(other.d_ptr); } + void clear(); + void reserve(int size); + int capacity() const; + void closeSubpath(); void moveTo(const QPointF &p); @@ -138,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); @@ -188,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; @@ -333,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); |