summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qproperty.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/kernel/qproperty.cpp')
-rw-r--r--src/corelib/kernel/qproperty.cpp47
1 files changed, 7 insertions, 40 deletions
diff --git a/src/corelib/kernel/qproperty.cpp b/src/corelib/kernel/qproperty.cpp
index 4fdf0d8100..3a2c8dcc0c 100644
--- a/src/corelib/kernel/qproperty.cpp
+++ b/src/corelib/kernel/qproperty.cpp
@@ -196,39 +196,6 @@ QMetaType QUntypedPropertyBinding::valueMetaType() const
return d->valueMetaType();
}
-QPropertyBindingData::QPropertyBindingData(QPropertyBindingData &&other, QUntypedPropertyData *propertyDataPtr)
-{
- std::swap(d_ptr, other.d_ptr);
- QPropertyBindingDataPointer d{this};
- d.setFirstObserver(nullptr);
- if (auto binding = d.bindingPtr())
- binding->setProperty(propertyDataPtr);
-}
-
-void QPropertyBindingData::moveAssign(QPropertyBindingData &&other, QUntypedPropertyData *propertyDataPtr)
-{
- if (&other == this)
- return;
-
- QPropertyBindingDataPointer d{this};
- auto observer = d.firstObserver();
- d.setFirstObserver(nullptr);
-
- if (auto binding = d.bindingPtr()) {
- binding->unlinkAndDeref();
- d_ptr &= FlagMask;
- }
-
- std::swap(d_ptr, other.d_ptr);
-
- if (auto binding = d.bindingPtr())
- binding->setProperty(propertyDataPtr);
-
- d.setFirstObserver(observer.ptr);
-
- // The caller will have to notify observers.
-}
-
QPropertyBindingData::~QPropertyBindingData()
{
QPropertyBindingDataPointer d{this};
@@ -286,6 +253,12 @@ QUntypedPropertyBinding QPropertyBindingData::setBinding(const QUntypedPropertyB
return QUntypedPropertyBinding(oldBinding.data());
}
+QPropertyBindingData::QPropertyBindingData(QPropertyBindingData &&other) : d_ptr(std::exchange(other.d_ptr, 0))
+{
+ QPropertyBindingDataPointer d{this};
+ d.fixupFirstObserverAfterMove();
+}
+
QPropertyBindingPrivate *QPropertyBindingData::binding() const
{
QPropertyBindingDataPointer d{this};
@@ -694,12 +667,6 @@ QString QPropertyBindingError::description() const
*/
/*!
- \fn template <typename T> QProperty<T> &QProperty<T>::operator=(QProperty &&other)
-
- Move-assigns \a other to this QProperty instance.
-*/
-
-/*!
\fn template <typename T> QProperty<T>::QProperty(const QPropertyBinding<T> &binding)
Constructs a property that is tied to the provided \a binding expression. The
@@ -1395,7 +1362,7 @@ struct QBindingStoragePrivate
if (index == newData->size)
index = 0;
}
- new (pp + index) Pair{p->data, QPropertyBindingData(std::move(p->bindingData), p->data)};
+ new (pp + index) Pair{p->data, QPropertyBindingData(std::move(p->bindingData))};
}
}
// data has been moved, no need to call destructors on old Pairs