summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2014-08-25 11:23:18 +0200
committerMarc Mutz <marc.mutz@kdab.com>2016-02-13 18:18:32 +0000
commitafc7da09ec01b1658451d36c52f22c0d203f593d (patch)
tree737e3497b4cfb3df14a8d678b2fbcd0fa104d4cf /src/gui/painting
parent0df5c366e50b9533fd8ea3f31c4c360ae7f4c5b6 (diff)
QRegion: add move ctor
After this change, this was the distribution of calls in QtGui and QtWidgets when the patch was developed for 5.4: QtGui QtWidgets move 23 63 copy 23 36 Change-Id: If3f536e52fc242c585e7fa0662049c0657efcc9c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/gui/painting')
-rw-r--r--src/gui/painting/qregion.cpp10
-rw-r--r--src/gui/painting/qregion.h2
2 files changed, 12 insertions, 0 deletions
diff --git a/src/gui/painting/qregion.cpp b/src/gui/painting/qregion.cpp
index 5bfe681e73..d104f9ff5a 100644
--- a/src/gui/painting/qregion.cpp
+++ b/src/gui/painting/qregion.cpp
@@ -210,6 +210,16 @@ QT_BEGIN_NAMESPACE
*/
/*!
+ \fn QRegion::QRegion(QRegion &&other)
+ \since 5.7
+
+ Move-constructs a new region from region \a other.
+ After the call, \a other is null.
+
+ \sa isNull()
+*/
+
+/*!
\fn QRegion::QRegion(const QBitmap &bm)
Constructs a region from the bitmap \a bm.
diff --git a/src/gui/painting/qregion.h b/src/gui/painting/qregion.h
index 94e2db2648..d66f80fcde 100644
--- a/src/gui/painting/qregion.h
+++ b/src/gui/painting/qregion.h
@@ -68,6 +68,8 @@ public:
QRegion(const QRect &r, RegionType t = Rectangle);
QRegion(const QPolygon &pa, Qt::FillRule fillRule = Qt::OddEvenFill);
QRegion(const QRegion &region);
+ QRegion(QRegion &&other) Q_DECL_NOTHROW
+ : d(other.d) { other.d = const_cast<QRegionData*>(&shared_empty); }
QRegion(const QBitmap &bitmap);
~QRegion();
QRegion &operator=(const QRegion &);