summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-05-07 07:17:37 (GMT)
committerKent Hansen <khansen@trolltech.com>2009-05-07 10:41:11 (GMT)
commit1e404bcb6df5127a1d0e24ed11cce1c0260a57e9 (patch)
treea24b91f6541f6cab3f0f44515201c54cda53a7b4
parent2edb7ce649bba7221f02aeae021645e219e25f70 (diff)
downloadQt-1e404bcb6df5127a1d0e24ed11cce1c0260a57e9.zip
Qt-1e404bcb6df5127a1d0e24ed11cce1c0260a57e9.tar.gz
Qt-1e404bcb6df5127a1d0e24ed11cce1c0260a57e9.tar.bz2
store top-level animation in dedicated variable
The animation itself is used by subsequent code, so we mustn't change it.
-rw-r--r--src/corelib/statemachine/qstatemachine.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp
index 7f2132d..4533115 100644
--- a/src/corelib/statemachine/qstatemachine.cpp
+++ b/src/corelib/statemachine/qstatemachine.cpp
@@ -713,9 +713,10 @@ void QStateMachinePrivate::applyProperties(const QList<QAbstractTransition*> &tr
// Stop the (top-level) animation.
// ### Stopping nested animation has weird behavior.
- while (QAnimationGroup *group = anim->group())
- anim = group;
- anim->stop();
+ QAbstractAnimation *topLevelAnim = anim;
+ while (QAnimationGroup *group = topLevelAnim->group())
+ topLevelAnim = group;
+ topLevelAnim->stop();
if (resetAnimationEndValues.contains(anim)) {
qobject_cast<QVariantAnimation*>(anim)->setEndValue(QVariant()); // ### generalize