diff options
author | Sami Merila <sami.merila@nokia.com> | 2011-03-29 09:26:18 (GMT) |
---|---|---|
committer | Sami Merila <sami.merila@nokia.com> | 2011-03-29 09:26:18 (GMT) |
commit | 32dcbc38ef2332bd93d66782eae2de5020e998b4 (patch) | |
tree | d367ea12c5cbf2f3b55420e2419e04b4cba1d90b /src/corelib/animation/qabstractanimation.cpp | |
parent | 4f8d4492b8cafcdef71b5b40482c1eddb23062ab (diff) | |
parent | 85360044130a13f7041e5291334423ad0b180cb3 (diff) | |
download | Qt-32dcbc38ef2332bd93d66782eae2de5020e998b4.zip Qt-32dcbc38ef2332bd93d66782eae2de5020e998b4.tar.gz Qt-32dcbc38ef2332bd93d66782eae2de5020e998b4.tar.bz2 |
Merge commit 'refs/merge-requests/2584' of gitorious.org:qt/qt into merge-requests/2584
Diffstat (limited to 'src/corelib/animation/qabstractanimation.cpp')
-rw-r--r-- | src/corelib/animation/qabstractanimation.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp index 5e6110f..a9bb129 100644 --- a/src/corelib/animation/qabstractanimation.cpp +++ b/src/corelib/animation/qabstractanimation.cpp @@ -167,7 +167,7 @@ Q_GLOBAL_STATIC(QThreadStorage<QUnifiedTimer *>, unifiedTimer) QUnifiedTimer::QUnifiedTimer() : QObject(), lastTick(0), timingInterval(DEFAULT_TIMER_INTERVAL), - currentAnimationIdx(0), consistentTiming(false), slowMode(false), + insideTick(false), currentAnimationIdx(0), consistentTiming(false), slowMode(false), slowdownFactor(5.0f), isPauseTimerActive(false), runningLeafAnimations(0) { time.invalidate(); @@ -205,6 +205,10 @@ void QUnifiedTimer::ensureTimerUpdate() void QUnifiedTimer::updateAnimationsTime() { + //setCurrentTime can get this called again while we're the for loop. At least with pauseAnimations + if(insideTick) + return; + qint64 totalElapsed = time.elapsed(); // ignore consistentTiming in case the pause timer is active int delta = (consistentTiming && !isPauseTimerActive) ? @@ -222,12 +226,14 @@ void QUnifiedTimer::updateAnimationsTime() //it might happen in some cases that the time doesn't change because events are delayed //when the CPU load is high if (delta) { + insideTick = true; 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); } + insideTick = false; currentAnimationIdx = 0; } } |