summaryrefslogtreecommitdiffstats
path: root/src/corelib/statemachine/qstatemachine.cpp
diff options
context:
space:
mode:
authorKent Hansen <kent.hansen@nokia.com>2012-07-04 13:03:48 +0200
committerQt by Nokia <qt-info@nokia.com>2012-07-10 06:20:31 +0200
commit2f18e7276298451a48593e7e5bb71a9e9deaffcf (patch)
tree513732d6b350522494373178b4cd2bba11f91b17 /src/corelib/statemachine/qstatemachine.cpp
parentbc5a4d28afbd273adeaae75ebd4aeb97337df6ed (diff)
statemachine: Purge restorable properties when they are restored
Previously, a registered restorable property would only be unregistered if the property was animated (see QStateMachinePrivate::_q_animationFinished()). But if a property is set directly, it should also be unregistered; otherwise, the state machine would use the previously saved (stale) value the next time that property should be restored. Change-Id: I5d246aa5355ddd0ba5f81b0186a9f0e4f3bbaa3f Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Diffstat (limited to 'src/corelib/statemachine/qstatemachine.cpp')
-rw-r--r--src/corelib/statemachine/qstatemachine.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp
index ec93bb1b2d..2453ae970d 100644
--- a/src/corelib/statemachine/qstatemachine.cpp
+++ b/src/corelib/statemachine/qstatemachine.cpp
@@ -841,6 +841,8 @@ void QStateMachinePrivate::applyProperties(const QList<QAbstractTransition*> &tr
for (int i = 0; i < assignments.size(); ++i) {
const QPropertyAssignment &assn = assignments.at(i);
assn.write();
+ if (!assn.explicitlySet)
+ unregisterRestorable(assn.object, assn.propertyName);
}
}
}