summaryrefslogtreecommitdiffstats
path: root/src/corelib/animation
diff options
context:
space:
mode:
authorLeonardo Sobral Cunha <leo.cunha@nokia.com>2009-10-02 15:13:11 (GMT)
committerLeonardo Sobral Cunha <leo.cunha@nokia.com>2009-10-07 15:37:46 (GMT)
commit3dbc4ad00f809b110f143f2473c230bc5c481391 (patch)
tree065245053d9fe95d6ea238ed1a78350f45244623 /src/corelib/animation
parent6480937b52c4d18dce0288c69586467f36584590 (diff)
downloadQt-3dbc4ad00f809b110f143f2473c230bc5c481391.zip
Qt-3dbc4ad00f809b110f143f2473c230bc5c481391.tar.gz
Qt-3dbc4ad00f809b110f143f2473c230bc5c481391.tar.bz2
In QAbstractAnimation::setState setCurrentTime when animation pauses
If we want to avoid timer ticks in QPauseAnimation, We need to update the current time when an animation pauses, for being able to resume correctly. Reviewed-by: thierry
Diffstat (limited to 'src/corelib/animation')
-rw-r--r--src/corelib/animation/qabstractanimation.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp
index 2769040..a4a8853 100644
--- a/src/corelib/animation/qabstractanimation.cpp
+++ b/src/corelib/animation/qabstractanimation.cpp
@@ -292,22 +292,23 @@ void QAbstractAnimationPrivate::setState(QAbstractAnimation::State newState)
switch (state) {
case QAbstractAnimation::Paused:
+ q->setCurrentTime(currentTime);
+ if (!guard)
+ return;
+ QUnifiedTimer::instance()->unregisterAnimation(q);
+ break;
case QAbstractAnimation::Running:
- //this ensures that the value is updated now that the animation is running
- if(oldState == QAbstractAnimation::Stopped) {
+ // this ensures that the value is updated now that the animation is running
+ if (oldState == QAbstractAnimation::Stopped) {
q->setCurrentTime(currentTime);
if (!guard)
return;
}
- // Register timer if our parent is not running.
if (state == QAbstractAnimation::Running) {
- if (!group || group->state() == QAbstractAnimation::Stopped) {
+ // Register timer if our parent is not running
+ if (!group || group->state() == QAbstractAnimation::Stopped)
QUnifiedTimer::instance()->registerAnimation(q);
- }
- } else {
- //new state is paused
- QUnifiedTimer::instance()->unregisterAnimation(q);
}
break;
case QAbstractAnimation::Stopped: