diff options
author | Alexey Edelev <alexey.edelev@qt.io> | 2021-01-12 16:37:09 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-01-14 16:19:58 +0000 |
commit | 1381aff5850dbcb53de8b62a90f0c87cba1bb765 (patch) | |
tree | f5f375598e5a64ff66f00d8c31db03928bf78cd6 /src/quick/util/qquickstate.cpp | |
parent | c24757f1b642102852beb1f62c83bfd76ca31567 (diff) |
Do not revert properties of deleted objects
If state contains revert action of properties of deleted objects,
we should avoid adding them to apply list
Fixes: QTBUG-85106
Change-Id: Iff57eb9958a054476096f6d951ab7390277a2b39
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 96763dbb105fde20431a264789ac27abfdab841c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/quick/util/qquickstate.cpp')
-rw-r--r-- | src/quick/util/qquickstate.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/quick/util/qquickstate.cpp b/src/quick/util/qquickstate.cpp index 71ab1f4d62..6a72754bde 100644 --- a/src/quick/util/qquickstate.cpp +++ b/src/quick/util/qquickstate.cpp @@ -635,6 +635,11 @@ void QQuickState::apply(QQuickTransition *trans, QQuickState *revert) } } if (!found) { + // If revert list contains bindings assigned to deleted objects, we need to + // prevent reverting properties of those objects. + if (d->revertList.at(ii).binding() && !d->revertList.at(ii).property().object()) { + continue; + } QVariant cur = d->revertList.at(ii).property().read(); QQmlPropertyPrivate::removeBinding(d->revertList.at(ii).property()); |