diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2009-11-05 12:48:28 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2009-11-05 23:07:34 (GMT) |
commit | 41c740c0e3fe0edb08dea9cfabfb91c26baecee5 (patch) | |
tree | 10b5da1c14487108a5e7994e5baefeb6cae77c3e | |
parent | 8ad965ff19490d8c38ff4562f61fa0ca5b33e3e4 (diff) | |
download | Qt-41c740c0e3fe0edb08dea9cfabfb91c26baecee5.zip Qt-41c740c0e3fe0edb08dea9cfabfb91c26baecee5.tar.gz Qt-41c740c0e3fe0edb08dea9cfabfb91c26baecee5.tar.bz2 |
Another fix for the registration of the animations
-rw-r--r-- | src/corelib/animation/qabstractanimation.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp index 6ab5bde..94e88aa 100644 --- a/src/corelib/animation/qabstractanimation.cpp +++ b/src/corelib/animation/qabstractanimation.cpp @@ -347,13 +347,16 @@ void QAbstractAnimationPrivate::setState(QAbstractAnimation::State newState) state = newState; QWeakPointer<QAbstractAnimation> guard(q); - //unregistration of the animation must always happen before calls to + //(un)registration of the animation must always happen before calls to //virtual function (updateState) to ensure a correct state of the timer + bool isTopLevel = !group || group->state() == QAbstractAnimation::Stopped; if (oldState == QAbstractAnimation::Running) { if (newState == QAbstractAnimation::Paused && hasRegisteredTimer) QUnifiedTimer::instance()->ensureTimerUpdate(); //the animation, is not running any more QUnifiedTimer::instance()->unregisterAnimation(q); + } else { + QUnifiedTimer::instance()->registerAnimation(q, isTopLevel); } q->updateState(oldState, newState); @@ -370,8 +373,6 @@ void QAbstractAnimationPrivate::setState(QAbstractAnimation::State newState) break; case QAbstractAnimation::Running: { - bool isTopLevel = !group || group->state() == QAbstractAnimation::Stopped; - QUnifiedTimer::instance()->registerAnimation(q, isTopLevel); // this ensures that the value is updated now that the animation is running if (oldState == QAbstractAnimation::Stopped) { |