summaryrefslogtreecommitdiffstats
path: root/src/corelib/animation
diff options
context:
space:
mode:
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: