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/image | |
parent | eb82959d6688f9e58be4b67670afba3649f1f799 (diff) |
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/image')
-rw-r--r-- | src/gui/image/qicon.cpp | 2 | ||||
-rw-r--r-- | src/gui/image/qicon.h | 12 | ||||
-rw-r--r-- | src/gui/image/qimage.cpp | 2 | ||||
-rw-r--r-- | src/gui/image/qimage.h | 9 | ||||
-rw-r--r-- | src/gui/image/qpicture.h | 5 | ||||
-rw-r--r-- | src/gui/image/qpixmap.h | 5 |
6 files changed, 20 insertions, 15 deletions
diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp index 6d7a40c2ef..40ba84bb14 100644 --- a/src/gui/image/qicon.cpp +++ b/src/gui/image/qicon.cpp @@ -606,7 +606,7 @@ QFactoryLoader *qt_iconEngineFactoryLoader() /*! Constructs a null icon. */ -QIcon::QIcon() +QIcon::QIcon() Q_DECL_NOEXCEPT : d(0) { } diff --git a/src/gui/image/qicon.h b/src/gui/image/qicon.h index d87468b4f0..63e77eef99 100644 --- a/src/gui/image/qicon.h +++ b/src/gui/image/qicon.h @@ -51,22 +51,24 @@ public: enum Mode { Normal, Disabled, Active, Selected }; enum State { On, Off }; - QIcon(); + QIcon() Q_DECL_NOEXCEPT; QIcon(const QPixmap &pixmap); QIcon(const QIcon &other); #ifdef Q_COMPILER_RVALUE_REFS - QIcon(QIcon &&other) - :d(0) { qSwap(d, other.d); } + QIcon(QIcon &&other) Q_DECL_NOEXCEPT + : d(0) + { qSwap(d, other.d); } #endif explicit QIcon(const QString &fileName); // file or resource name explicit QIcon(QIconEngine *engine); ~QIcon(); QIcon &operator=(const QIcon &other); #ifdef Q_COMPILER_RVALUE_REFS - inline QIcon &operator=(QIcon &&other) + inline QIcon &operator=(QIcon &&other) Q_DECL_NOEXCEPT { qSwap(d, other.d); return *this; } #endif - inline void swap(QIcon &other) { qSwap(d, other.d); } + inline void swap(QIcon &other) Q_DECL_NOEXCEPT + { qSwap(d, other.d); } operator QVariant() const; diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index 1bbbc3e1f2..8a0f570f47 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -734,7 +734,7 @@ bool QImageData::checkForAlphaPixels() const \sa isNull() */ -QImage::QImage() +QImage::QImage() Q_DECL_NOEXCEPT : QPaintDevice() { d = 0; diff --git a/src/gui/image/qimage.h b/src/gui/image/qimage.h index 99044bd4e3..26057f366c 100644 --- a/src/gui/image/qimage.h +++ b/src/gui/image/qimage.h @@ -121,7 +121,7 @@ public: #endif }; - QImage(); + QImage() Q_DECL_NOEXCEPT; QImage(const QSize &size, Format format); QImage(int width, int height, Format format); QImage(uchar *data, int width, int height, Format format, QImageCleanupFunction cleanupFunction = 0, void *cleanupInfo = 0); @@ -136,7 +136,7 @@ public: QImage(const QImage &); #ifdef Q_COMPILER_RVALUE_REFS - inline QImage(QImage &&other) + inline QImage(QImage &&other) Q_DECL_NOEXCEPT : QPaintDevice(), d(0) { qSwap(d, other.d); } #endif @@ -144,10 +144,11 @@ public: QImage &operator=(const QImage &); #ifdef Q_COMPILER_RVALUE_REFS - inline QImage &operator=(QImage &&other) + inline QImage &operator=(QImage &&other) Q_DECL_NOEXCEPT { qSwap(d, other.d); return *this; } #endif - inline void swap(QImage &other) { qSwap(d, other.d); } + inline void swap(QImage &other) Q_DECL_NOEXCEPT + { qSwap(d, other.d); } bool isNull() const; diff --git a/src/gui/image/qpicture.h b/src/gui/image/qpicture.h index 9bb193321b..c3897a1935 100644 --- a/src/gui/image/qpicture.h +++ b/src/gui/image/qpicture.h @@ -72,10 +72,11 @@ public: QPicture& operator=(const QPicture &p); #ifdef Q_COMPILER_RVALUE_REFS - inline QPicture &operator=(QPicture &&other) + inline QPicture &operator=(QPicture &&other) Q_DECL_NOEXCEPT { qSwap(d_ptr, other.d_ptr); return *this; } #endif - inline void swap(QPicture &other) { d_ptr.swap(other.d_ptr); } + inline void swap(QPicture &other) Q_DECL_NOEXCEPT + { d_ptr.swap(other.d_ptr); } void detach(); bool isDetached() const; diff --git a/src/gui/image/qpixmap.h b/src/gui/image/qpixmap.h index 810883ea6c..51b02acfcf 100644 --- a/src/gui/image/qpixmap.h +++ b/src/gui/image/qpixmap.h @@ -67,10 +67,11 @@ public: QPixmap &operator=(const QPixmap &); #ifdef Q_COMPILER_RVALUE_REFS - inline QPixmap &operator=(QPixmap &&other) + inline QPixmap &operator=(QPixmap &&other) Q_DECL_NOEXCEPT { qSwap(data, other.data); return *this; } #endif - inline void swap(QPixmap &other) { qSwap(data, other.data); } + inline void swap(QPixmap &other) Q_DECL_NOEXCEPT + { qSwap(data, other.data); } operator QVariant() const; |