diff options
-rw-r--r-- | src/qml/jsruntime/qv4persistent_p.h | 2 | ||||
-rw-r--r-- | src/qml/qml/qqmlanybinding_p.h | 4 | ||||
-rw-r--r-- | src/qml/qml/qqmlobjectcreator_p.h | 36 | ||||
-rw-r--r-- | src/qml/qml/qqmlproperty.h | 2 | ||||
-rw-r--r-- | src/qml/qml/qqmlpropertycachecreator_p.h | 2 |
5 files changed, 23 insertions, 23 deletions
diff --git a/src/qml/jsruntime/qv4persistent_p.h b/src/qml/jsruntime/qv4persistent_p.h index 1437736818..a0f2cb6a9d 100644 --- a/src/qml/jsruntime/qv4persistent_p.h +++ b/src/qml/jsruntime/qv4persistent_p.h @@ -104,7 +104,7 @@ public: PersistentValue &operator=(const PersistentValue &other); PersistentValue(PersistentValue &&other) noexcept : val(std::exchange(other.val, nullptr)) {} - void swap(PersistentValue &other) noexcept { qSwap(val, other.val); } + void swap(PersistentValue &other) noexcept { qt_ptr_swap(val, other.val); } QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_MOVE_AND_SWAP(PersistentValue); ~PersistentValue() { PersistentValueStorage::free(val); } diff --git a/src/qml/qml/qqmlanybinding_p.h b/src/qml/qml/qqmlanybinding_p.h index 116c5b81cc..00b5980000 100644 --- a/src/qml/qml/qqmlanybinding_p.h +++ b/src/qml/qml/qqmlanybinding_p.h @@ -415,8 +415,8 @@ public: QQmlAnyBinding(const QQmlAnyBinding &other) noexcept { *this = other; } QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_MOVE_AND_SWAP(QQmlAnyBinding) - friend void swap(QQmlAnyBinding &a, QQmlAnyBinding &b) noexcept { qSwap(a.d, b.d); } - void swap(QQmlAnyBinding &other) noexcept { qSwap(d, other.d); } + void swap(QQmlAnyBinding &other) noexcept { d.swap(other.d); } + friend void swap(QQmlAnyBinding &lhs, QQmlAnyBinding &rhs) noexcept { lhs.swap(rhs); } QQmlAnyBinding &operator=(const QQmlAnyBinding &other) noexcept { diff --git a/src/qml/qml/qqmlobjectcreator_p.h b/src/qml/qml/qqmlobjectcreator_p.h index bdecf563c2..194a071d95 100644 --- a/src/qml/qml/qqmlobjectcreator_p.h +++ b/src/qml/qml/qqmlobjectcreator_p.h @@ -248,7 +248,7 @@ private: QQmlVMEMetaObject *vmeMetaObject = QQmlVMEMetaObject::get(instance); QObject *scopeObject = instance; - qSwap(_scopeObject, scopeObject); + qt_ptr_swap(_scopeObject, scopeObject); QV4::Scope valueScope(v4); QScopedValueRollback<QV4::Value*> jsObjectGuard(sharedState->allJavaScriptObjects, @@ -257,32 +257,32 @@ private: Q_ASSERT(topLevelCreator); QV4::QmlContext *qmlContext = static_cast<QV4::QmlContext *>(valueScope.alloc()); - qSwap(_qmlContext, qmlContext); + qt_ptr_swap(_qmlContext, qmlContext); - qSwap(_propertyCache, cache); - qSwap(_qobject, instance); + _propertyCache.swap(cache); + qt_ptr_swap(_qobject, instance); int objectIndex = deferredIndex; - qSwap(_compiledObjectIndex, objectIndex); + std::swap(_compiledObjectIndex, objectIndex); const QV4::CompiledData::Object *obj = compilationUnit->objectAt(_compiledObjectIndex); - qSwap(_compiledObject, obj); - qSwap(_ddata, declarativeData); - qSwap(_bindingTarget, bindingTarget); - qSwap(_vmeMetaObject, vmeMetaObject); + qt_ptr_swap(_compiledObject, obj); + qt_ptr_swap(_ddata, declarativeData); + qt_ptr_swap(_bindingTarget, bindingTarget); + qt_ptr_swap(_vmeMetaObject, vmeMetaObject); f(); - qSwap(_vmeMetaObject, vmeMetaObject); - qSwap(_bindingTarget, bindingTarget); - qSwap(_ddata, declarativeData); - qSwap(_compiledObject, obj); - qSwap(_compiledObjectIndex, objectIndex); - qSwap(_qobject, instance); - qSwap(_propertyCache, cache); + qt_ptr_swap(_vmeMetaObject, vmeMetaObject); + qt_ptr_swap(_bindingTarget, bindingTarget); + qt_ptr_swap(_ddata, declarativeData); + qt_ptr_swap(_compiledObject, obj); + std::swap(_compiledObjectIndex, objectIndex); + qt_ptr_swap(_qobject, instance); + _propertyCache.swap(cache); - qSwap(_qmlContext, qmlContext); - qSwap(_scopeObject, scopeObject); + qt_ptr_swap(_qmlContext, qmlContext); + qt_ptr_swap(_scopeObject, scopeObject); } }; diff --git a/src/qml/qml/qqmlproperty.h b/src/qml/qml/qqmlproperty.h index dbffce9437..0dfdb6c759 100644 --- a/src/qml/qml/qqmlproperty.h +++ b/src/qml/qml/qqmlproperty.h @@ -94,7 +94,7 @@ public: QQmlProperty(QQmlProperty &&other) noexcept : d(std::exchange(other.d, nullptr)) {} QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_MOVE_AND_SWAP(QQmlProperty); - void swap(QQmlProperty &other) noexcept { qSwap(d, other.d); } + void swap(QQmlProperty &other) noexcept { qt_ptr_swap(d, other.d); } bool operator==(const QQmlProperty &) const; Type type() const; diff --git a/src/qml/qml/qqmlpropertycachecreator_p.h b/src/qml/qml/qqmlpropertycachecreator_p.h index 5aa1abcbe7..f683dc208c 100644 --- a/src/qml/qml/qqmlpropertycachecreator_p.h +++ b/src/qml/qml/qqmlpropertycachecreator_p.h @@ -871,7 +871,7 @@ inline void QQmlPropertyCacheAliasCreator<ObjectContainer>::appendAliasPropertie } } - qSwap(objectsWithAliases, pendingObjects); + objectsWithAliases = std::move(pendingObjects); } while (!objectsWithAliases.isEmpty()); } |