From 58992993a381fedd2f0e36edb73a63cfb9b3bcea Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 10 Feb 2020 15:12:32 +0100 Subject: Add support for explicitly marking a property as dirty When a binding is backed by old-style property captures, then having this API is needed for Qml. Change-Id: Icf51efe057eaf845969ed2cda52d082dedde677e Reviewed-by: Ulf Hermann --- src/corelib/kernel/qproperty.h | 2 ++ src/corelib/kernel/qpropertybinding.cpp | 7 +++++++ 2 files changed, 9 insertions(+) (limited to 'src') diff --git a/src/corelib/kernel/qproperty.h b/src/corelib/kernel/qproperty.h index 7fd8c2e17e..5e1d8ec2f6 100644 --- a/src/corelib/kernel/qproperty.h +++ b/src/corelib/kernel/qproperty.h @@ -137,6 +137,8 @@ public: QMetaType valueMetaType() const; + void setDirty(bool dirty = true); + private: explicit QUntypedPropertyBinding(const QPropertyBindingPrivatePtr &priv); friend class QtPrivate::QPropertyBase; diff --git a/src/corelib/kernel/qpropertybinding.cpp b/src/corelib/kernel/qpropertybinding.cpp index fb372fcdfc..78d24cbdc1 100644 --- a/src/corelib/kernel/qpropertybinding.cpp +++ b/src/corelib/kernel/qpropertybinding.cpp @@ -162,4 +162,11 @@ QMetaType QUntypedPropertyBinding::valueMetaType() const return d->metaType; } +void QUntypedPropertyBinding::setDirty(bool dirty) +{ + if (!d) + return; + d->dirty = dirty; +} + QT_END_NAMESPACE -- cgit v1.2.3