diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2010-05-05 04:32:45 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2010-05-05 04:37:52 (GMT) |
commit | 846210c6381827396868d15cdbb6d42daabda147 (patch) | |
tree | ff3003b0fa316258cae7ce43bbd7aff74f4ebb71 /src/declarative | |
parent | 9719866c686805d69b0026f555c97594e09c836f (diff) | |
download | Qt-846210c6381827396868d15cdbb6d42daabda147.zip Qt-846210c6381827396868d15cdbb6d42daabda147.tar.gz Qt-846210c6381827396868d15cdbb6d42daabda147.tar.bz2 |
Don't start valuesource animations until all component objects have been completed.
Task-number: QTBUG-9413
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/util/qdeclarativeanimation.cpp | 10 | ||||
-rw-r--r-- | src/declarative/util/qdeclarativeanimation_p.h | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp index 4059522..d9abe71 100644 --- a/src/declarative/util/qdeclarativeanimation.cpp +++ b/src/declarative/util/qdeclarativeanimation.cpp @@ -55,6 +55,7 @@ #include <qdeclarativemetatype_p.h> #include <qdeclarativevaluetype_p.h> #include <qdeclarativeproperty_p.h> +#include <qdeclarativeengine_p.h> #include <qvariant.h> #include <qcolor.h> @@ -178,6 +179,10 @@ void QDeclarativeAbstractAnimation::setRunning(bool r) d->running = r; if (r == false) d->avoidPropertyValueSourceStart = true; + else { + QDeclarativeEnginePrivate *engPriv = QDeclarativeEnginePrivate::get(qmlEngine(this)); + engPriv->registerFinalizedParserStatusObject(this, this->metaObject()->indexOfSlot("componentFinalized()")); + } return; } @@ -268,6 +273,11 @@ void QDeclarativeAbstractAnimation::componentComplete() { Q_D(QDeclarativeAbstractAnimation); d->componentComplete = true; +} + +void QDeclarativeAbstractAnimation::componentFinalized() +{ + Q_D(QDeclarativeAbstractAnimation); if (d->running) { d->running = false; setRunning(true); diff --git a/src/declarative/util/qdeclarativeanimation_p.h b/src/declarative/util/qdeclarativeanimation_p.h index 40c893c..e7cd8a8 100644 --- a/src/declarative/util/qdeclarativeanimation_p.h +++ b/src/declarative/util/qdeclarativeanimation_p.h @@ -133,6 +133,7 @@ public: private Q_SLOTS: void timelineComplete(); + void componentFinalized(); private: virtual void setTarget(const QDeclarativeProperty &); |