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 <ulf.hermann@qt.io>
This commit is contained in:
Simon Hausmann 2020-02-10 15:12:32 +01:00
parent 1fcce51053
commit 58992993a3
2 changed files with 9 additions and 0 deletions

View File

@ -137,6 +137,8 @@ public:
QMetaType valueMetaType() const;
void setDirty(bool dirty = true);
private:
explicit QUntypedPropertyBinding(const QPropertyBindingPrivatePtr &priv);
friend class QtPrivate::QPropertyBase;

View File

@ -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