From 2551d3f934b41b4b5e8f03c4db6a107e064c138a Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Mon, 14 Feb 2022 08:57:09 +0100 Subject: =?UTF-8?q?QQmlStrongJSQObjectReference:=20rename=20setObject()=20?= =?UTF-8?q?argument=20o=20=E2=86=92=20obj?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It shadowed a member of *this (QQmlGuardImpl::o). Change-Id: Ibb4175c27c240102efa86d34b5a822ea70a3a4c3 Reviewed-by: Fabian Kosmale (cherry picked from commit 88b2a368dcb3e84c762143307d2af90a5314b419) Reviewed-by: Qt Cherry-pick Bot --- src/qml/qml/qqmlguard_p.h | 10 +++++----- 1 file 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 class QQmlStrongJSQObjectReference : public QQmlGuard { 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::operator=(o); + this->QQmlGuard::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; } -- cgit v1.2.3