diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2010-11-02 14:20:38 (GMT) |
---|---|---|
committer | Olivier Goffart <olivier.goffart@nokia.com> | 2010-11-03 10:50:48 (GMT) |
commit | 86ea8521c6f145be24c40c799b6b4e8f6e854e2b (patch) | |
tree | bbceb07abeb3f8b974287ea648fd995b4ba8345c /src/gui/painting | |
parent | d12681a4cf1227d0e92fc7cf12aa3977e6ffe3fe (diff) | |
download | Qt-86ea8521c6f145be24c40c799b6b4e8f6e854e2b.zip Qt-86ea8521c6f145be24c40c799b6b4e8f6e854e2b.tar.gz Qt-86ea8521c6f145be24c40c799b6b4e8f6e854e2b.tar.bz2 |
Add member-swap to shared datatypes that don't have it.
For consistency.
Merge-request: 871
Reviewed-by: Olivier Goffart <olivier.goffart@nokia.com>
Diffstat (limited to 'src/gui/painting')
-rw-r--r-- | src/gui/painting/qbrush.cpp | 9 | ||||
-rw-r--r-- | src/gui/painting/qbrush.h | 2 | ||||
-rw-r--r-- | src/gui/painting/qpainterpath.cpp | 8 | ||||
-rw-r--r-- | src/gui/painting/qpainterpath.h | 1 | ||||
-rw-r--r-- | src/gui/painting/qpen.cpp | 8 | ||||
-rw-r--r-- | src/gui/painting/qpen.h | 1 | ||||
-rw-r--r-- | src/gui/painting/qpolygon.cpp | 2 | ||||
-rw-r--r-- | src/gui/painting/qregion.cpp | 8 | ||||
-rw-r--r-- | src/gui/painting/qregion.h | 1 |
9 files changed, 40 insertions, 0 deletions
diff --git a/src/gui/painting/qbrush.cpp b/src/gui/painting/qbrush.cpp index d0788c7..5b35fc5 100644 --- a/src/gui/painting/qbrush.cpp +++ b/src/gui/painting/qbrush.cpp @@ -635,6 +635,15 @@ QBrush &QBrush::operator=(const QBrush &b) return *this; } + +/*! + \fn void QBrush::swap(QBrush &other) + \since 4.8 + + Swaps brush \a other with this brush. This operation is very + fast and never fails. +*/ + /*! Returns the brush as a QVariant */ diff --git a/src/gui/painting/qbrush.h b/src/gui/painting/qbrush.h index efc720b..f9acded 100644 --- a/src/gui/painting/qbrush.h +++ b/src/gui/painting/qbrush.h @@ -96,6 +96,8 @@ public: inline QBrush &operator=(QBrush &&other) { qSwap(d, other.d); return *this; } #endif + inline void swap(QBrush &other) { qSwap(d, other.d); } + operator QVariant() const; inline Qt::BrushStyle style() const; diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp index ffd0d5c..7d6ea12 100644 --- a/src/gui/painting/qpainterpath.cpp +++ b/src/gui/painting/qpainterpath.cpp @@ -576,6 +576,14 @@ QPainterPath &QPainterPath::operator=(const QPainterPath &other) } /*! + \fn void QPainterPath::swap(QPainterPath &other) + \since 4.8 + + Swaps painter path \a other with this painter path. This operation is very + fast and never fails. +*/ + +/*! Destroys this QPainterPath object. */ QPainterPath::~QPainterPath() diff --git a/src/gui/painting/qpainterpath.h b/src/gui/painting/qpainterpath.h index 9a7b60a..82facf8 100644 --- a/src/gui/painting/qpainterpath.h +++ b/src/gui/painting/qpainterpath.h @@ -100,6 +100,7 @@ public: { qSwap(d_ptr, other.d_ptr); return *this; } #endif ~QPainterPath(); + inline void swap(QPainterPath &other) { d_ptr.swap(other.d_ptr); } void closeSubpath(); diff --git a/src/gui/painting/qpen.cpp b/src/gui/painting/qpen.cpp index 2e43984..0137763 100644 --- a/src/gui/painting/qpen.cpp +++ b/src/gui/painting/qpen.cpp @@ -383,6 +383,14 @@ QPen &QPen::operator=(const QPen &p) } /*! + \fn void QPen::swap(QPen &other) + \since 4.8 + + Swaps pen \a other with this pen. This operation is very + fast and never fails. +*/ + +/*! Returns the pen as a QVariant. */ QPen::operator QVariant() const diff --git a/src/gui/painting/qpen.h b/src/gui/painting/qpen.h index 4006112..a7b946c 100644 --- a/src/gui/painting/qpen.h +++ b/src/gui/painting/qpen.h @@ -78,6 +78,7 @@ public: inline QPen &operator=(QPen &&other) { qSwap(d, other.d); return *this; } #endif + inline void swap(QPen &other) { qSwap(d, other.d); } Qt::PenStyle style() const; void setStyle(Qt::PenStyle); diff --git a/src/gui/painting/qpolygon.cpp b/src/gui/painting/qpolygon.cpp index 76b11d7..83323d0 100644 --- a/src/gui/painting/qpolygon.cpp +++ b/src/gui/painting/qpolygon.cpp @@ -709,6 +709,8 @@ QPolygon QPolygonF::toPolygon() const /*! \fn void QPolygonF::swap(QPolygonF &other) + \since 4.8 + Swaps polygon \a other with this polygon. This operation is very fast and never fails. */ diff --git a/src/gui/painting/qregion.cpp b/src/gui/painting/qregion.cpp index c5d5dc9..cd997f4 100644 --- a/src/gui/painting/qregion.cpp +++ b/src/gui/painting/qregion.cpp @@ -391,6 +391,14 @@ void QRegion::exec(const QByteArray &buffer, int ver, QDataStream::ByteOrder byt */ /*! + \fn void QRegion::swap(QRegion &other) + \since 4.8 + + Swaps region \a other with this region. This operation is very + fast and never fails. +*/ + +/*! \relates QRegion Writes the region \a r to the stream \a s and returns a reference diff --git a/src/gui/painting/qregion.h b/src/gui/painting/qregion.h index 91d82e0..50052b3 100644 --- a/src/gui/painting/qregion.h +++ b/src/gui/painting/qregion.h @@ -85,6 +85,7 @@ public: inline QRegion &operator=(QRegion &&other) { qSwap(d, other.d); return *this; } #endif + inline void swap(QRegion &other) { qSwap(d, other.d); } #ifdef QT3_SUPPORT inline QT3_SUPPORT bool isNull() const { return isEmpty(); } #endif |