Skip to content

Commit

Permalink
Add support for explicitly marking a property as dirty
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
tronical committed Mar 19, 2020
1 parent 1fcce51 commit 5899299
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/corelib/kernel/qproperty.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ class Q_CORE_EXPORT QUntypedPropertyBinding

QMetaType valueMetaType() const;

void setDirty(bool dirty = true);

private:
explicit QUntypedPropertyBinding(const QPropertyBindingPrivatePtr &priv);
friend class QtPrivate::QPropertyBase;
Expand Down
7 changes: 7 additions & 0 deletions src/corelib/kernel/qpropertybinding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 5899299

Please sign in to comment.