diff options
-rw-r--r-- | src/corelib/itemmodels/qabstractitemmodel.h | 5 | ||||
-rw-r--r-- | src/corelib/tools/qbitarray.h | 1 | ||||
-rw-r--r-- | src/corelib/tools/qset.h | 1 |
3 files changed, 7 insertions, 0 deletions
diff --git a/src/corelib/itemmodels/qabstractitemmodel.h b/src/corelib/itemmodels/qabstractitemmodel.h index 6a57ccaca8..a0ac33e8a8 100644 --- a/src/corelib/itemmodels/qabstractitemmodel.h +++ b/src/corelib/itemmodels/qabstractitemmodel.h @@ -110,6 +110,11 @@ public: inline bool operator!=(const QPersistentModelIndex &other) const { return !operator==(other); } QPersistentModelIndex &operator=(const QPersistentModelIndex &other); +#ifdef Q_COMPILER_RVALUE_REFS + inline QPersistentModelIndex(QPersistentModelIndex &&other) : d(other.d) { other.d = 0; } + inline QPersistentModelIndex &operator=(QPersistentModelIndex &&other) + { qSwap(d, other.d); return *this; } +#endif inline void swap(QPersistentModelIndex &other) { qSwap(d, other.d); } bool operator==(const QModelIndex &other) const; bool operator!=(const QModelIndex &other) const; diff --git a/src/corelib/tools/qbitarray.h b/src/corelib/tools/qbitarray.h index 1103712627..eaf9b2ff25 100644 --- a/src/corelib/tools/qbitarray.h +++ b/src/corelib/tools/qbitarray.h @@ -61,6 +61,7 @@ public: QBitArray(const QBitArray &other) : d(other.d) {} inline QBitArray &operator=(const QBitArray &other) { d = other.d; return *this; } #ifdef Q_COMPILER_RVALUE_REFS + inline QBitArray(QBitArray &&other) : d(std::move(other.d)) {} inline QBitArray &operator=(QBitArray &&other) { qSwap(d, other.d); return *this; } #endif diff --git a/src/corelib/tools/qset.h b/src/corelib/tools/qset.h index d5c3637293..1390c67c80 100644 --- a/src/corelib/tools/qset.h +++ b/src/corelib/tools/qset.h @@ -70,6 +70,7 @@ public: inline QSet<T> &operator=(const QSet<T> &other) { q_hash = other.q_hash; return *this; } #ifdef Q_COMPILER_RVALUE_REFS + inline QSet(QSet &&other) : q_hash(qMove(other.q_hash)) {} inline QSet<T> &operator=(QSet<T> &&other) { qSwap(q_hash, other.q_hash); return *this; } #endif |