summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-11-05 12:48:28 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-11-05 12:49:17 (GMT)
commit23390af0bfb8828e0e58819a5ad2249f34e12205 (patch)
tree509c95f8cb887f03f5dd35dbcd6add718aebf7ab
parent4bf7f90a27377f439e86d6175e5e3cdebd131be0 (diff)
downloadQt-23390af0bfb8828e0e58819a5ad2249f34e12205.zip
Qt-23390af0bfb8828e0e58819a5ad2249f34e12205.tar.gz
Qt-23390af0bfb8828e0e58819a5ad2249f34e12205.tar.bz2
Another fix for the registration of the animations
-rw-r--r--src/corelib/animation/qabstractanimation.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp
index 0cdc40c..d46ac92 100644
--- a/src/corelib/animation/qabstractanimation.cpp
+++ b/src/corelib/animation/qabstractanimation.cpp
@@ -348,13 +348,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(newState, oldState);
@@ -371,8 +374,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) {