summaryrefslogtreecommitdiffstats
path: root/src/corelib/animation
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2011-02-18 06:19:23 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2011-03-16 03:03:02 (GMT)
commitb3f605aebb90dc651e73a252788a81cb530a74b9 (patch)
treeaeeff40a5c0beb83e89c3df55fce23a9815b1b61 /src/corelib/animation
parent99512251be8e5814238ec398854a8aa71fa8b25d (diff)
downloadQt-b3f605aebb90dc651e73a252788a81cb530a74b9.zip
Qt-b3f605aebb90dc651e73a252788a81cb530a74b9.tar.gz
Qt-b3f605aebb90dc651e73a252788a81cb530a74b9.tar.bz2
Stop the animation driver when there are no more animations.
Change-Id: If03c9e4539e984db725f7e7d89e8b565890fcbed Reviewed-by: Gunnar Sletta
Diffstat (limited to 'src/corelib/animation')
-rw-r--r--src/corelib/animation/qabstractanimation.cpp3
-rw-r--r--src/corelib/animation/qabstractanimation_p.h3
2 files changed, 5 insertions, 1 deletions
diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp
index 2d5cfab..a562542 100644
--- a/src/corelib/animation/qabstractanimation.cpp
+++ b/src/corelib/animation/qabstractanimation.cpp
@@ -254,7 +254,8 @@ void QUnifiedTimer::restartAnimationTimer()
} else if (!driver->isRunning() || isPauseTimerActive) {
driver->start();
isPauseTimerActive = false;
- }
+ } else if (runningLeafAnimations == 0)
+ driver->stop();
}
void QUnifiedTimer::setTimingInterval(int interval)
diff --git a/src/corelib/animation/qabstractanimation_p.h b/src/corelib/animation/qabstractanimation_p.h
index 1ab05cd..2c0eee7 100644
--- a/src/corelib/animation/qabstractanimation_p.h
+++ b/src/corelib/animation/qabstractanimation_p.h
@@ -184,6 +184,9 @@ public:
void restartAnimationTimer();
void updateAnimationsTime();
+ //useful for profiling/debugging
+ int runningAnimationCount() { return animations.count(); }
+
protected:
void timerEvent(QTimerEvent *);