From ce3dee765c858a0b573d468ef8fee6b838e576d1 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Fri, 3 Feb 2012 12:26:37 +1000 Subject: Add and use new animation backend. The new backend improves performance, and allows us to create multiple running animation jobs from a single Transition. It is based off of the existing Qt animation framework. Change-Id: Id1d0162f6e5c65bf31267f3f9f2042c354375d57 Reviewed-by: Yunqiao Yin --- .../data/springanimation2.qml | 19 +++++++++++++------ .../tst_qdeclarativespringanimation.cpp | 4 +++- 2 files changed, 16 insertions(+), 7 deletions(-) (limited to 'tests/auto/qtquick2/qdeclarativespringanimation') 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(c.create()); + QObject *root = c.create(); + + QDeclarativeSpringAnimation *obj = root->findChild(); QVERIFY(obj != 0); -- cgit v1.2.3