diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-04-21 16:25:25 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-05-04 11:27:48 +0000 |
commit | e445f3c47bea3e2d3dffa1215b24cb90dccd8c73 (patch) | |
tree | c27d983a48b283852dfe9975fddb8fc2854162bb /src/gui/painting | |
parent | eb82959d6688f9e58be4b67670afba3649f1f799 (diff) | |
download | qtbase-e445f3c47bea3e2d3dffa1215b24cb90dccd8c73.tar.gz |
Add noexcept to move constructors and assignment operators
Add the noexcept attribute to all move constructors and assignment
operators in QtGui that didn't already have it.
Change-Id: Idcdf79ae8349b8793e7394b5ae7c08e6111fbc9a
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Diffstat (limited to 'src/gui/painting')
-rw-r--r-- | src/gui/painting/qbrush.h | 5 | ||||
-rw-r--r-- | src/gui/painting/qpaintdevice.cpp | 2 | ||||
-rw-r--r-- | src/gui/painting/qpaintdevice.h | 2 | ||||
-rw-r--r-- | src/gui/painting/qpainterpath.cpp | 2 | ||||
-rw-r--r-- | src/gui/painting/qpainterpath.h | 6 | ||||
-rw-r--r-- | src/gui/painting/qregion.h | 4 |
6 files changed, 11 insertions, 10 deletions
diff --git a/src/gui/painting/qbrush.h b/src/gui/painting/qbrush.h index a3b88a50ef..ceb95f5676 100644 --- a/src/gui/painting/qbrush.h +++ b/src/gui/painting/qbrush.h @@ -73,10 +73,11 @@ public: ~QBrush(); QBrush &operator=(const QBrush &brush); #ifdef Q_COMPILER_RVALUE_REFS - inline QBrush &operator=(QBrush &&other) + inline QBrush &operator=(QBrush &&other) Q_DECL_NOEXCEPT { qSwap(d, other.d); return *this; } #endif - inline void swap(QBrush &other) { qSwap(d, other.d); } + inline void swap(QBrush &other) Q_DECL_NOEXCEPT + { qSwap(d, other.d); } operator QVariant() const; diff --git a/src/gui/painting/qpaintdevice.cpp b/src/gui/painting/qpaintdevice.cpp index 36e0bbe223..bbf8e8f170 100644 --- a/src/gui/painting/qpaintdevice.cpp +++ b/src/gui/painting/qpaintdevice.cpp @@ -35,7 +35,7 @@ QT_BEGIN_NAMESPACE -QPaintDevice::QPaintDevice() +QPaintDevice::QPaintDevice() Q_DECL_NOEXCEPT { reserved = 0; painters = 0; diff --git a/src/gui/painting/qpaintdevice.h b/src/gui/painting/qpaintdevice.h index 7c756c66de..4eb972786b 100644 --- a/src/gui/painting/qpaintdevice.h +++ b/src/gui/painting/qpaintdevice.h @@ -80,7 +80,7 @@ public: int depth() const { return metric(PdmDepth); } protected: - QPaintDevice(); + QPaintDevice() Q_DECL_NOEXCEPT; virtual int metric(PaintDeviceMetric metric) const; virtual void initPainter(QPainter *painter) const; virtual QPaintDevice *redirected(QPoint *offset) const; diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp index e3c6eabbc3..88cf05c646 100644 --- a/src/gui/painting/qpainterpath.cpp +++ b/src/gui/painting/qpainterpath.cpp @@ -521,7 +521,7 @@ void QPainterPath::setElementPositionAt(int i, qreal x, qreal y) /*! Constructs an empty QPainterPath object. */ -QPainterPath::QPainterPath() +QPainterPath::QPainterPath() Q_DECL_NOEXCEPT : d_ptr(0) { } diff --git a/src/gui/painting/qpainterpath.h b/src/gui/painting/qpainterpath.h index eb32782a96..e037cd5bfb 100644 --- a/src/gui/painting/qpainterpath.h +++ b/src/gui/painting/qpainterpath.h @@ -81,16 +81,16 @@ public: inline bool operator!=(const Element &e) const { return !operator==(e); } }; - QPainterPath(); + QPainterPath() Q_DECL_NOEXCEPT; explicit QPainterPath(const QPointF &startPoint); QPainterPath(const QPainterPath &other); QPainterPath &operator=(const QPainterPath &other); #ifdef Q_COMPILER_RVALUE_REFS - inline QPainterPath &operator=(QPainterPath &&other) + inline QPainterPath &operator=(QPainterPath &&other) Q_DECL_NOEXCEPT { qSwap(d_ptr, other.d_ptr); return *this; } #endif ~QPainterPath(); - inline void swap(QPainterPath &other) { d_ptr.swap(other.d_ptr); } + inline void swap(QPainterPath &other) Q_DECL_NOEXCEPT { d_ptr.swap(other.d_ptr); } void closeSubpath(); diff --git a/src/gui/painting/qregion.h b/src/gui/painting/qregion.h index bab07b5a5d..ab2404e887 100644 --- a/src/gui/painting/qregion.h +++ b/src/gui/painting/qregion.h @@ -66,10 +66,10 @@ public: ~QRegion(); QRegion &operator=(const QRegion &); #ifdef Q_COMPILER_RVALUE_REFS - inline QRegion &operator=(QRegion &&other) + inline QRegion &operator=(QRegion &&other) Q_DECL_NOEXCEPT { qSwap(d, other.d); return *this; } #endif - inline void swap(QRegion &other) { qSwap(d, other.d); } + inline void swap(QRegion &other) Q_DECL_NOEXCEPT { qSwap(d, other.d); } bool isEmpty() const; bool isNull() const; |