summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-04-21 16:25:25 +0200
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-05-04 11:27:48 +0000
commite445f3c47bea3e2d3dffa1215b24cb90dccd8c73 (patch)
treec27d983a48b283852dfe9975fddb8fc2854162bb /src/gui/kernel
parenteb82959d6688f9e58be4b67670afba3649f1f799 (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/kernel')
-rw-r--r--src/gui/kernel/qevent.h9
-rw-r--r--src/gui/kernel/qpalette.h10
2 files changed, 12 insertions, 7 deletions
diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h
index e931e28a2e..a1f32026ac 100644
--- a/src/gui/kernel/qevent.h
+++ b/src/gui/kernel/qevent.h
@@ -789,8 +789,10 @@ public:
explicit TouchPoint(int id = -1);
TouchPoint(const TouchPoint &other);
#ifdef Q_COMPILER_RVALUE_REFS
- TouchPoint(TouchPoint &&other) : d(other.d) { other.d = 0; }
- TouchPoint &operator=(TouchPoint &&other)
+ TouchPoint(TouchPoint &&other) Q_DECL_NOEXCEPT
+ : d(0)
+ { qSwap(d, other.d); }
+ TouchPoint &operator=(TouchPoint &&other) Q_DECL_NOEXCEPT
{ qSwap(d, other.d); return *this; }
#endif
~TouchPoint();
@@ -798,7 +800,8 @@ public:
TouchPoint &operator=(const TouchPoint &other)
{ if ( d != other.d ) { TouchPoint copy(other); swap(copy); } return *this; }
- void swap(TouchPoint &other) { qSwap(d, other.d); }
+ void swap(TouchPoint &other) Q_DECL_NOEXCEPT
+ { qSwap(d, other.d); }
int id() const;
diff --git a/src/gui/kernel/qpalette.h b/src/gui/kernel/qpalette.h
index e8b35aa82a..78dd2ce9d7 100644
--- a/src/gui/kernel/qpalette.h
+++ b/src/gui/kernel/qpalette.h
@@ -61,16 +61,18 @@ public:
~QPalette();
QPalette &operator=(const QPalette &palette);
#ifdef Q_COMPILER_RVALUE_REFS
- QPalette(QPalette &&other) Q_DECL_NOTHROW
- : d(other.d), data(other.data) { other.d = Q_NULLPTR; }
- inline QPalette &operator=(QPalette &&other)
+ QPalette(QPalette &&other) Q_DECL_NOEXCEPT
+ : d(other.d), data(other.data)
+ { other.d = Q_NULLPTR; }
+ inline QPalette &operator=(QPalette &&other) Q_DECL_NOEXCEPT
{
for_faster_swapping_dont_use = other.for_faster_swapping_dont_use;
qSwap(d, other.d); return *this;
}
#endif
- void swap(QPalette &other) {
+ void swap(QPalette &other) Q_DECL_NOEXCEPT
+ {
qSwap(d, other.d);
qSwap(for_faster_swapping_dont_use, other.for_faster_swapping_dont_use);
}