diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-02-14 08:57:09 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-02-15 08:03:18 +0000 |
commit | 2551d3f934b41b4b5e8f03c4db6a107e064c138a (patch) | |
tree | ea3a038030b3e25f6ee946400bfe5c964f073471 | |
parent | 98294034fe7bda665deb3a949fb0d0710762da3d (diff) |
QQmlStrongJSQObjectReference: rename setObject() argument o → obj
It shadowed a member of *this (QQmlGuardImpl::o).
Change-Id: Ibb4175c27c240102efa86d34b5a822ea70a3a4c3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 88b2a368dcb3e84c762143307d2af90a5314b419)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/qml/qml/qqmlguard_p.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/qml/qml/qqmlguard_p.h b/src/qml/qml/qqmlguard_p.h index 3ac63926a0..85b2b898df 100644 --- a/src/qml/qml/qqmlguard_p.h +++ b/src/qml/qml/qqmlguard_p.h @@ -110,19 +110,19 @@ template <typename T> class QQmlStrongJSQObjectReference : public QQmlGuard<T> { public: - void setObject(T *o, QObject *parent) { + void setObject(T *obj, QObject *parent) { T *old = this->object(); - if (o == old) + if (obj == old) return; if (m_jsOwnership && old && old->parent() == parent) QQml_setParent_noEvent(old, nullptr); - this->QQmlGuard<T>::operator=(o); + this->QQmlGuard<T>::operator=(obj); - if (o && !o->parent() && !QQmlData::keepAliveDuringGarbageCollection(o)) { + if (obj && !obj->parent() && !QQmlData::keepAliveDuringGarbageCollection(obj)) { m_jsOwnership = true; - QQml_setParent_noEvent(o, parent); + QQml_setParent_noEvent(obj, parent); } else { m_jsOwnership = false; } |