diff options
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/declarative/animations/data/valuesource.qml | 14 | ||||
-rw-r--r-- | tests/auto/declarative/animations/data/valuesource2.qml | 14 | ||||
-rw-r--r-- | tests/auto/declarative/animations/tst_animations.cpp | 30 |
3 files changed, 58 insertions, 0 deletions
diff --git a/tests/auto/declarative/animations/data/valuesource.qml b/tests/auto/declarative/animations/data/valuesource.qml new file mode 100644 index 0000000..c35063d --- /dev/null +++ b/tests/auto/declarative/animations/data/valuesource.qml @@ -0,0 +1,14 @@ +import Qt 4.6 + +Rectangle { + width: 400 + height: 400 + Rectangle { + id: rect + objectName: "MyRect" + color: "red" + width: 50; height: 50 + x: 100; y: 100 + x: NumberAnimation { id: anim; objectName: "MyAnim"; to: 200 } + } +} diff --git a/tests/auto/declarative/animations/data/valuesource2.qml b/tests/auto/declarative/animations/data/valuesource2.qml new file mode 100644 index 0000000..1a60542 --- /dev/null +++ b/tests/auto/declarative/animations/data/valuesource2.qml @@ -0,0 +1,14 @@ +import Qt 4.6 + +Rectangle { + width: 400 + height: 400 + Rectangle { + id: rect + objectName: "MyRect" + color: "red" + width: 50; height: 50 + x: 100; y: 100 + x: NumberAnimation { id: anim; objectName: "MyAnim"; running: false; to: 200 } + } +} diff --git a/tests/auto/declarative/animations/tst_animations.cpp b/tests/auto/declarative/animations/tst_animations.cpp index 5026f6f..17085af 100644 --- a/tests/auto/declarative/animations/tst_animations.cpp +++ b/tests/auto/declarative/animations/tst_animations.cpp @@ -68,6 +68,7 @@ private slots: void easingStringConversion(); void invalidDuration(); void attached(); + void propertyValueSourceDefaultStart(); }; #define QTIMED_COMPARE(lhs, rhs) do { \ @@ -576,6 +577,35 @@ void tst_animations::attached() QVERIFY(rect); } +void tst_animations::propertyValueSourceDefaultStart() +{ + { + QmlEngine engine; + + QmlComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/valuesource.qml")); + + QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(c.create()); + QVERIFY(rect); + + QmlAbstractAnimation *myAnim = rect->findChild<QmlAbstractAnimation*>("MyAnim"); + QVERIFY(myAnim); + QVERIFY(myAnim->isRunning()); + } + + { + QmlEngine engine; + + QmlComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/valuesource2.qml")); + + QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(c.create()); + QVERIFY(rect); + + QmlAbstractAnimation *myAnim = rect->findChild<QmlAbstractAnimation*>("MyAnim"); + QVERIFY(myAnim); + QVERIFY(myAnim->isRunning() == false); + } +} + QTEST_MAIN(tst_animations) #include "tst_animations.moc" |