summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/declarative/util/qdeclarativeanimation.cpp10
-rw-r--r--src/declarative/util/qdeclarativeanimation_p.h1
-rw-r--r--tests/auto/declarative/qmlvisual/animation/pauseAnimation/pauseAnimation-visual.qml4
3 files changed, 13 insertions, 2 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 &);
diff --git a/tests/auto/declarative/qmlvisual/animation/pauseAnimation/pauseAnimation-visual.qml b/tests/auto/declarative/qmlvisual/animation/pauseAnimation/pauseAnimation-visual.qml
index d82c6df..cc9a639 100644
--- a/tests/auto/declarative/qmlvisual/animation/pauseAnimation/pauseAnimation-visual.qml
+++ b/tests/auto/declarative/qmlvisual/animation/pauseAnimation/pauseAnimation-visual.qml
@@ -16,7 +16,7 @@ Rectangle {
id: img
source: "pics/qtlogo.png"
x: 60-width/2
- y: 100
+ y: 200-img.height
SequentialAnimation on y {
loops: Animation.Infinite
NumberAnimation {
@@ -24,7 +24,7 @@ Rectangle {
easing.type: "InOutQuad"
}
NumberAnimation {
- to: 100
+ to: 200-img.height
easing.type: "OutBounce"
duration: 2000
}