aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qtquick2/qdeclarativespringanimation
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qtquick2/qdeclarativespringanimation')
-rw-r--r--tests/auto/qtquick2/qdeclarativespringanimation/data/springanimation2.qml19
-rw-r--r--tests/auto/qtquick2/qdeclarativespringanimation/tst_qdeclarativespringanimation.cpp4
2 files changed, 16 insertions, 7 deletions
diff --git a/tests/auto/qtquick2/qdeclarativespringanimation/data/springanimation2.qml b/tests/auto/qtquick2/qdeclarativespringanimation/data/springanimation2.qml
index 172cc57ca8..9f72e51533 100644
--- a/tests/auto/qtquick2/qdeclarativespringanimation/data/springanimation2.qml
+++ b/tests/auto/qtquick2/qdeclarativespringanimation/data/springanimation2.qml
@@ -1,9 +1,16 @@
import QtQuick 2.0
-SpringAnimation {
- to: 1.44; velocity: 0.9
- spring: 1.0; damping: 0.5
- epsilon: 0.25; modulus: 360.0
- mass: 2.0;
- running: true;
+Item {
+ Item {
+ id: item
+ }
+
+ SpringAnimation {
+ target: item; property: "x"
+ to: 1.44; velocity: 0.9
+ spring: 1.0; damping: 0.5
+ epsilon: 0.25; modulus: 360.0
+ mass: 2.0;
+ running: true;
+ }
}
diff --git a/tests/auto/qtquick2/qdeclarativespringanimation/tst_qdeclarativespringanimation.cpp b/tests/auto/qtquick2/qdeclarativespringanimation/tst_qdeclarativespringanimation.cpp
index 15a3263eed..64956d7753 100644
--- a/tests/auto/qtquick2/qdeclarativespringanimation/tst_qdeclarativespringanimation.cpp
+++ b/tests/auto/qtquick2/qdeclarativespringanimation/tst_qdeclarativespringanimation.cpp
@@ -88,7 +88,9 @@ void tst_qdeclarativespringanimation::values()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, testFileUrl("springanimation2.qml"));
- QDeclarativeSpringAnimation *obj = qobject_cast<QDeclarativeSpringAnimation*>(c.create());
+ QObject *root = c.create();
+
+ QDeclarativeSpringAnimation *obj = root->findChild<QDeclarativeSpringAnimation*>();
QVERIFY(obj != 0);