summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
diff options
context:
space:
mode:
authorQt CI Bot <qt_ci_bot@qt-project.org>2021-04-16 22:01:34 +0000
committerQt CI Bot <qt_ci_bot@qt-project.org>2021-04-16 22:01:34 +0000
commit042e728752c3e35c0f8d567c1c70ab407bfff57f (patch)
treeab7807f6ff47685b1f49161b87a3534edbfd0dd5 /src/corelib/kernel
parent09d99a8d5f4a0e359862b9b9463d7260ff33cea1 (diff)
parente835bccb1e53c2eeb20b5f95a2c0ea4beb547b7c (diff)
Merge integration refs/builds/qtci/dev/1618599897
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r--src/corelib/kernel/qproperty.cpp3
-rw-r--r--src/corelib/kernel/qproperty_p.h8
2 files changed, 11 insertions, 0 deletions
diff --git a/src/corelib/kernel/qproperty.cpp b/src/corelib/kernel/qproperty.cpp
index a5354532d2..7c8477e31a 100644
--- a/src/corelib/kernel/qproperty.cpp
+++ b/src/corelib/kernel/qproperty.cpp
@@ -508,6 +508,9 @@ void QPropertyBindingData::removeBinding_helper()
auto *existingBinding = d.binding();
Q_ASSERT(existingBinding);
+ if (existingBinding->isSticky()) {
+ return;
+ }
auto observer = existingBinding->takeObservers();
d_ref() = 0;
diff --git a/src/corelib/kernel/qproperty_p.h b/src/corelib/kernel/qproperty_p.h
index 58a000e9bf..6a074efebb 100644
--- a/src/corelib/kernel/qproperty_p.h
+++ b/src/corelib/kernel/qproperty_p.h
@@ -184,6 +184,11 @@ private:
bool hasBindingWrapper:1;
// used to detect binding loops for eagerly evaluated properties
bool isQQmlPropertyBinding:1;
+ /* a sticky binding does not get removed in removeBinding
+ this is used to support QQmlPropertyData::DontRemoveBinding
+ in qtdeclarative
+ */
+ bool m_sticky:1;
const QtPrivate::BindingFunctionVTable *vtable;
@@ -234,11 +239,14 @@ public:
size_t dependencyObserverCount = 0;
bool isUpdating() {return updating;}
+ void setSticky(bool keep = true) {m_sticky = keep;}
+ bool isSticky() {return m_sticky;}
QPropertyBindingPrivate(QMetaType metaType, const QtPrivate::BindingFunctionVTable *vtable,
const QPropertyBindingSourceLocation &location, bool isQQmlPropertyBinding=false)
: hasBindingWrapper(false)
, isQQmlPropertyBinding(isQQmlPropertyBinding)
+ , m_sticky(false)
, vtable(vtable)
, location(location)
, metaType(metaType)