diff options
author | David Boddie <david.boddie@nokia.com> | 2011-02-23 17:38:46 (GMT) |
---|---|---|
committer | David Boddie <david.boddie@nokia.com> | 2011-02-23 17:38:46 (GMT) |
commit | 4501731349406110ecde2d260a8ab1e1bcedf179 (patch) | |
tree | 5ec176e26bbd207741ca40a1704e654c30fb8571 /src/declarative/util/qdeclarativeanimation.cpp | |
parent | 3c982b5d214cc7a37ace1d956ac8fb0b9a281722 (diff) | |
parent | 0442b383dced6b5cc31e4fc2bf939e3125354f82 (diff) | |
download | Qt-4501731349406110ecde2d260a8ab1e1bcedf179.zip Qt-4501731349406110ecde2d260a8ab1e1bcedf179.tar.gz Qt-4501731349406110ecde2d260a8ab1e1bcedf179.tar.bz2 |
Merge commit 'refs/merge-requests/1108' of git://gitorious.org/qt/qt into merge-requests/1108
Conflicts:
doc/src/declarative/basictypes.qdoc
Diffstat (limited to 'src/declarative/util/qdeclarativeanimation.cpp')
-rw-r--r-- | src/declarative/util/qdeclarativeanimation.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp index e383d1e..dd06e4a 100644 --- a/src/declarative/util/qdeclarativeanimation.cpp +++ b/src/declarative/util/qdeclarativeanimation.cpp @@ -182,12 +182,11 @@ void QDeclarativeAbstractAnimation::setRunning(bool r) { Q_D(QDeclarativeAbstractAnimation); if (!d->componentComplete) { - if (d->running && r == d->running) //don't re-register - return; d->running = r; if (r == false) d->avoidPropertyValueSourceStart = true; - else { + else if (!d->registered) { + d->registered = true; QDeclarativeEnginePrivate *engPriv = QDeclarativeEnginePrivate::get(qmlEngine(this)); engPriv->registerFinalizedParserStatusObject(this, this->metaObject()->indexOfSlot("componentFinalized()")); } @@ -204,6 +203,7 @@ void QDeclarativeAbstractAnimation::setRunning(bool r) d->running = r; if (d->running) { + bool supressStart = false; if (d->alwaysRunToEnd && d->loopCount != 1 && qtAnimation()->state() == QAbstractAnimation::Running) { //we've restarted before the final loop finished; restore proper loop count @@ -211,6 +211,7 @@ void QDeclarativeAbstractAnimation::setRunning(bool r) qtAnimation()->setLoopCount(d->loopCount); else qtAnimation()->setLoopCount(qtAnimation()->currentLoop() + d->loopCount); + supressStart = true; //we want the animation to continue, rather than restart } if (!d->connectedTimeLine) { @@ -218,7 +219,8 @@ void QDeclarativeAbstractAnimation::setRunning(bool r) this, SLOT(timelineComplete())); d->connectedTimeLine = true; } - d->commence(); + if (!supressStart) + d->commence(); emit started(); } else { if (d->alwaysRunToEnd) { |