summaryrefslogtreecommitdiffstats
path: root/src/corelib/animation/qabstractanimation.cpp
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2009-09-23 06:51:56 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2009-09-23 06:51:56 (GMT)
commit369afa4bcee7addbf1a7e8556cf0b521bb75c57d (patch)
tree11fc05b6aa85397d0384a14917c07bb3c0d964cf /src/corelib/animation/qabstractanimation.cpp
parent91c1ec98c10d8ce89932f7df69e3de33d80beeff (diff)
parent0873efff5197cb92bce378c67cd744753f809bae (diff)
downloadQt-369afa4bcee7addbf1a7e8556cf0b521bb75c57d.zip
Qt-369afa4bcee7addbf1a7e8556cf0b521bb75c57d.tar.gz
Qt-369afa4bcee7addbf1a7e8556cf0b521bb75c57d.tar.bz2
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6
Diffstat (limited to 'src/corelib/animation/qabstractanimation.cpp')
-rw-r--r--src/corelib/animation/qabstractanimation.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp
index 3d3eafd..6306882 100644
--- a/src/corelib/animation/qabstractanimation.cpp
+++ b/src/corelib/animation/qabstractanimation.cpp
@@ -214,14 +214,18 @@ void QUnifiedTimer::timerEvent(QTimerEvent *event)
time.start();
}
} else if (event->timerId() == animationTimer.timerId()) {
- const int delta = lastTick - oldLastTick;
- for (currentAnimationIdx = 0; currentAnimationIdx < animations.count(); ++currentAnimationIdx) {
- QAbstractAnimation *animation = animations.at(currentAnimationIdx);
- int elapsed = QAbstractAnimationPrivate::get(animation)->totalCurrentTime
- + (animation->direction() == QAbstractAnimation::Forward ? delta : -delta);
- animation->setCurrentTime(elapsed);
+ //we make sure we only call update time if the time has actually changed
+ //it might happen in some cases that the time doesn't change because events are delayed
+ //when the CPU load is high
+ if (const int delta = lastTick - oldLastTick) {
+ for (currentAnimationIdx = 0; currentAnimationIdx < animations.count(); ++currentAnimationIdx) {
+ QAbstractAnimation *animation = animations.at(currentAnimationIdx);
+ int elapsed = QAbstractAnimationPrivate::get(animation)->totalCurrentTime
+ + (animation->direction() == QAbstractAnimation::Forward ? delta : -delta);
+ animation->setCurrentTime(elapsed);
+ }
+ currentAnimationIdx = 0;
}
- currentAnimationIdx = 0;
}
}