diff options
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qcursor.h | 5 | ||||
-rw-r--r-- | src/gui/kernel/qkeysequence.h | 2 | ||||
-rw-r--r-- | src/gui/kernel/qpalette.h | 9 |
3 files changed, 6 insertions, 10 deletions
diff --git a/src/gui/kernel/qcursor.h b/src/gui/kernel/qcursor.h index 1ae60d9311..c1d45cc41b 100644 --- a/src/gui/kernel/qcursor.h +++ b/src/gui/kernel/qcursor.h @@ -87,9 +87,8 @@ public: QCursor(const QCursor &cursor); ~QCursor(); QCursor &operator=(const QCursor &cursor); - QCursor(QCursor &&other) noexcept : d(other.d) { other.d = nullptr; } - inline QCursor &operator=(QCursor &&other) noexcept - { swap(other); return *this; } + QCursor(QCursor &&other) noexcept : d(qExchange(other.d, nullptr)) {} + QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_MOVE_AND_SWAP(QCursor) void swap(QCursor &other) noexcept { qSwap(d, other.d); } diff --git a/src/gui/kernel/qkeysequence.h b/src/gui/kernel/qkeysequence.h index 880d0a581a..61001dddbc 100644 --- a/src/gui/kernel/qkeysequence.h +++ b/src/gui/kernel/qkeysequence.h @@ -185,7 +185,7 @@ public: operator QVariant() const; QKeyCombination operator[](uint i) const; QKeySequence &operator=(const QKeySequence &other); - QKeySequence &operator=(QKeySequence &&other) noexcept { swap(other); return *this; } + QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QKeySequence) void swap(QKeySequence &other) noexcept { qSwap(d, other.d); } bool operator==(const QKeySequence &other) const; diff --git a/src/gui/kernel/qpalette.h b/src/gui/kernel/qpalette.h index 8990f58512..7724480138 100644 --- a/src/gui/kernel/qpalette.h +++ b/src/gui/kernel/qpalette.h @@ -68,12 +68,9 @@ public: ~QPalette(); QPalette &operator=(const QPalette &palette); QPalette(QPalette &&other) noexcept - : d(other.d), data(other.data) - { other.d = nullptr; } - inline QPalette &operator=(QPalette &&other) noexcept - { - swap(other); return *this; - } + : d(qExchange(other.d, nullptr)), data(other.data) + {} + QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QPalette) void swap(QPalette &other) noexcept { |