summaryrefslogtreecommitdiffstats
path: root/src/corelib/animation/qabstractanimation.cpp
diff options
context:
space:
mode:
authormread <qt-info@nokia.com>2010-07-02 10:50:23 (GMT)
committermread <qt-info@nokia.com>2010-07-02 10:50:23 (GMT)
commit65316c0fcf9f0a406fd714622407e2b0e767fe7b (patch)
treeb22c5f1d6d314a972302b8a996bde43dc3ddd2af /src/corelib/animation/qabstractanimation.cpp
parent36f4d17a139c58cf00d3d9222dd2d35603ac09e8 (diff)
parent1636e03a2fda5108cb4389689a327e65c47dfe0e (diff)
downloadQt-65316c0fcf9f0a406fd714622407e2b0e767fe7b.zip
Qt-65316c0fcf9f0a406fd714622407e2b0e767fe7b.tar.gz
Qt-65316c0fcf9f0a406fd714622407e2b0e767fe7b.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt into 4.7
Conflicts fixed: src/s60installs/bwins/QtGuiu.def src/s60installs/eabi/QtGuiu.def
Diffstat (limited to 'src/corelib/animation/qabstractanimation.cpp')
-rw-r--r--src/corelib/animation/qabstractanimation.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp
index 04342e7..641b42b 100644
--- a/src/corelib/animation/qabstractanimation.cpp
+++ b/src/corelib/animation/qabstractanimation.cpp
@@ -168,7 +168,7 @@ Q_GLOBAL_STATIC(QThreadStorage<QUnifiedTimer *>, unifiedTimer)
QUnifiedTimer::QUnifiedTimer() :
QObject(), lastTick(0), timingInterval(DEFAULT_TIMER_INTERVAL),
currentAnimationIdx(0), consistentTiming(false), slowMode(false),
- isPauseTimerActive(false), runningLeafAnimations(0)
+ slowdownFactor(5.0f), isPauseTimerActive(false), runningLeafAnimations(0)
{
time.invalidate();
}
@@ -205,12 +205,18 @@ void QUnifiedTimer::ensureTimerUpdate()
void QUnifiedTimer::updateAnimationsTime()
{
+ qint64 totalElapsed = time.elapsed();
// ignore consistentTiming in case the pause timer is active
int delta = (consistentTiming && !isPauseTimerActive) ?
- timingInterval : time.elapsed() - lastTick;
- if (slowMode)
- delta /= 5;
- lastTick = time.elapsed();
+ timingInterval : totalElapsed - lastTick;
+ if (slowMode) {
+ if (slowdownFactor > 0)
+ delta = qRound(delta / slowdownFactor);
+ else
+ delta = 0;
+ }
+
+ lastTick = totalElapsed;
//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