aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlbinding.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2020-03-04 14:54:54 +0100
committerSimon Hausmann <simon.hausmann@qt.io>2020-04-03 12:35:23 +0200
commit448b2a5d838d082c66ab649cc7b71c31761bf409 (patch)
tree17888b90b9e03eb52e2ba03611146a66a87e31a1 /src/qml/qml/qqmlbinding.cpp
parentf1fd2b982a2ceae92da9b4a3875c65ed8a49560d (diff)
Replace QFlagPointer with QTaggedPointer
The latter has the advantage of allowing the use of a real type for the tag, instead of the generic flag/flag2 boolean accessors. Change-Id: Icc9e854ce4af3eb5808a4bed45aa22f377e223da Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlbinding.cpp')
-rw-r--r--src/qml/qml/qqmlbinding.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/qml/qml/qqmlbinding.cpp b/src/qml/qml/qqmlbinding.cpp
index 0dcc17d9e8..7de94fe3d5 100644
--- a/src/qml/qml/qqmlbinding.cpp
+++ b/src/qml/qml/qqmlbinding.cpp
@@ -232,7 +232,7 @@ protected:
QQmlPropertyData *pd = nullptr;
getPropertyData(&pd, nullptr);
QQmlBinding *thisPtr = this;
- pd->writeProperty(*m_target, &thisPtr, flags);
+ pd->writeProperty(m_target.data(), &thisPtr, flags);
}
};
@@ -546,10 +546,10 @@ void QQmlBinding::setEnabled(bool e, QQmlPropertyData::WriteFlags flags)
setEnabledFlag(e);
setNotifyOnValueChanged(e);
- m_nextBinding.setFlag2(); // Always use accessors, only not when:
+ m_nextBinding.setTag(m_nextBinding.tag().setFlag(CanUseAccessor)); // Always use accessors, only not when:
if (auto interceptorMetaObject = QQmlInterceptorMetaObject::get(targetObject())) {
if (!m_targetIndex.isValid() || interceptorMetaObject->intercepts(m_targetIndex))
- m_nextBinding.clearFlag2();
+ m_nextBinding.setTag(m_nextBinding.tag().setFlag(CanUseAccessor, false));
}
if (e && !wasEnabled)
@@ -606,7 +606,7 @@ bool QQmlBinding::setTarget(QObject *object, const QQmlPropertyData &core, const
}
m_targetIndex = QQmlPropertyIndex(coreIndex, valueTypeIndex);
- QQmlData *data = QQmlData::get(*m_target, true);
+ QQmlData *data = QQmlData::get(m_target.data(), true);
if (!data->propertyCache) {
data->propertyCache = QQmlEnginePrivate::get(engine())->cache(m_target->metaObject());
data->propertyCache->addref();
@@ -619,7 +619,7 @@ void QQmlBinding::getPropertyData(QQmlPropertyData **propertyData, QQmlPropertyD
{
Q_ASSERT(propertyData);
- QQmlData *data = QQmlData::get(*m_target, false);
+ QQmlData *data = QQmlData::get(m_target.data(), false);
Q_ASSERT(data);
if (Q_UNLIKELY(!data->propertyCache)) {