summaryrefslogtreecommitdiffstats
path: root/src/corelib/animation/qsequentialanimationgroup.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/animation/qsequentialanimationgroup.cpp')
-rw-r--r--src/corelib/animation/qsequentialanimationgroup.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/corelib/animation/qsequentialanimationgroup.cpp b/src/corelib/animation/qsequentialanimationgroup.cpp
index 059d62bdca..5a0982019f 100644
--- a/src/corelib/animation/qsequentialanimationgroup.cpp
+++ b/src/corelib/animation/qsequentialanimationgroup.cpp
@@ -81,6 +81,8 @@
QT_BEGIN_NAMESPACE
+typedef QList<QAbstractAnimation *>::ConstIterator AnimationListConstIt;
+
bool QSequentialAnimationGroupPrivate::atEnd() const
{
// we try to detect if we're at the end of the group
@@ -310,9 +312,8 @@ int QSequentialAnimationGroup::duration() const
Q_D(const QSequentialAnimationGroup);
int ret = 0;
- for (int i = 0; i < d->animations.size(); ++i) {
- QAbstractAnimation *animation = d->animations.at(i);
- const int currentDuration = animation->totalDuration();
+ for (AnimationListConstIt it = d->animations.constBegin(), cend = d->animations.constEnd(); it != cend; ++it) {
+ const int currentDuration = (*it)->totalDuration();
if (currentDuration == -1)
return -1; // Undetermined length