diff options
Diffstat (limited to 'tests/auto/declarative')
12 files changed, 64 insertions, 25 deletions
diff --git a/tests/auto/declarative/animations/data/badtype4.qml b/tests/auto/declarative/animations/data/badtype4.qml index 0c0a636..5db6c17 100644 --- a/tests/auto/declarative/animations/data/badtype4.qml +++ b/tests/auto/declarative/animations/data/badtype4.qml @@ -20,7 +20,7 @@ Rectangle { } transitions: Transition { //comment out each in turn to make sure each only animates the relevant property - ColorAnimation { properties: "x,color"; duration: 1000 } //x is real, color is color - NumberAnimation { properties: "x,color"; duration: 1000 } //x is real, color is color + ColorAnimation { matchProperties: "x,color"; duration: 1000 } //x is real, color is color + NumberAnimation { matchProperties: "x,color"; duration: 1000 } //x is real, color is color } } diff --git a/tests/auto/declarative/animations/data/dotproperty.qml b/tests/auto/declarative/animations/data/dotproperty.qml index ee076c2..3ddb002 100644 --- a/tests/auto/declarative/animations/data/dotproperty.qml +++ b/tests/auto/declarative/animations/data/dotproperty.qml @@ -16,9 +16,9 @@ Rectangle { } states: State { name: "state1" - PropertyChanges { target: MyRect; pen.color: "blue" } + PropertyChanges { target: MyRect; border.color: "blue" } } transitions: Transition { - ColorAnimation { properties: "pen.color"; duration: 1000 } + ColorAnimation { matchProperties: "border.color"; duration: 1000 } } } diff --git a/tests/auto/declarative/animations/data/mixedtype1.qml b/tests/auto/declarative/animations/data/mixedtype1.qml index ed50582..5ecf14f 100644 --- a/tests/auto/declarative/animations/data/mixedtype1.qml +++ b/tests/auto/declarative/animations/data/mixedtype1.qml @@ -19,6 +19,6 @@ Rectangle { PropertyChanges { target: MyRect; x: 200; border.width: 10 } } transitions: Transition { - PropertyAnimation { properties: "x,border.width"; duration: 1000 } //x is real, border.width is int + PropertyAnimation { matchProperties: "x,border.width"; duration: 1000 } //x is real, border.width is int } } diff --git a/tests/auto/declarative/animations/data/mixedtype2.qml b/tests/auto/declarative/animations/data/mixedtype2.qml index 4854c2e..645f1d0 100644 --- a/tests/auto/declarative/animations/data/mixedtype2.qml +++ b/tests/auto/declarative/animations/data/mixedtype2.qml @@ -19,6 +19,6 @@ Rectangle { PropertyChanges { target: MyRect; x: 200; color: "blue" } } transitions: Transition { - PropertyAnimation { properties: "x,color"; duration: 1000 } //x is real, color is color + PropertyAnimation { matchProperties: "x,color"; duration: 1000 } //x is real, color is color } } diff --git a/tests/auto/declarative/behaviors/data/nonSelecting.qml b/tests/auto/declarative/behaviors/data/nonSelecting.qml index ae9a9f5..ba36d93 100644 --- a/tests/auto/declarative/behaviors/data/nonSelecting.qml +++ b/tests/auto/declarative/behaviors/data/nonSelecting.qml @@ -8,7 +8,7 @@ Rectangle { width: 100; height: 100; color: "green" x: Behavior { objectName: "MyBehavior"; - NumberAnimation { target: rect; property: "y"; duration: 200; } + NumberAnimation { target: rect; property: "x"; duration: 200; } } } MouseRegion { diff --git a/tests/auto/declarative/behaviors/data/nonSelecting2.qml b/tests/auto/declarative/behaviors/data/nonSelecting2.qml new file mode 100644 index 0000000..e9849eb --- /dev/null +++ b/tests/auto/declarative/behaviors/data/nonSelecting2.qml @@ -0,0 +1,26 @@ +import Qt 4.6 +Rectangle { + width: 400 + height: 400 + Rectangle { + id: rect + objectName: "MyRect" + width: 100; height: 100; color: "green" + x: Behavior { + objectName: "MyBehavior"; + NumberAnimation { matchTargets: rect; matchProperties: "y"; duration: 200; } + } + } + MouseRegion { + id: clicker + anchors.fill: parent + } + states: State { + name: "moved" + when: clicker.pressed + PropertyChanges { + target: rect + x: 200 + } + } +} diff --git a/tests/auto/declarative/behaviors/tst_behaviors.cpp b/tests/auto/declarative/behaviors/tst_behaviors.cpp index da910d9..6343968 100644 --- a/tests/auto/declarative/behaviors/tst_behaviors.cpp +++ b/tests/auto/declarative/behaviors/tst_behaviors.cpp @@ -208,14 +208,27 @@ void tst_behaviors::emptyBehavior() void tst_behaviors::nonSelectingBehavior() { - QmlEngine engine; - QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/nonSelecting.qml")); - QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(c.create()); - QVERIFY(rect); + { + QmlEngine engine; + QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/nonSelecting.qml")); + QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(c.create()); + QVERIFY(rect); - rect->setState("moved"); - qreal x = qobject_cast<QmlGraphicsRectangle*>(rect->findChild<QmlGraphicsRectangle*>("MyRect"))->x(); - QCOMPARE(x, qreal(200)); //should change immediately + rect->setState("moved"); + qreal x = qobject_cast<QmlGraphicsRectangle*>(rect->findChild<QmlGraphicsRectangle*>("MyRect"))->x(); + QCOMPARE(x, qreal(200)); //should change immediately + } + + { + QmlEngine engine; + QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/nonSelecting2.qml")); + QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(c.create()); + QVERIFY(rect); + + rect->setState("moved"); + qreal x = qobject_cast<QmlGraphicsRectangle*>(rect->findChild<QmlGraphicsRectangle*>("MyRect"))->x(); + QCOMPARE(x, qreal(200)); //should change immediately + } } void tst_behaviors::reassignedAnimation() diff --git a/tests/auto/declarative/layouts/data/grid-animated.qml b/tests/auto/declarative/layouts/data/grid-animated.qml index 9edccaf..6b128ce 100644 --- a/tests/auto/declarative/layouts/data/grid-animated.qml +++ b/tests/auto/declarative/layouts/data/grid-animated.qml @@ -7,17 +7,17 @@ Item { columns: 3 add: Transition { NumberAnimation { - properties: "x,y"; from: -100 + matchProperties: "x,y"; from: -100 } } remove: Transition { NumberAnimation { - properties: "x,y"; to: -100 + matchProperties: "x,y"; to: -100 } } move: Transition { NumberAnimation { - properties: "x,y"; + matchProperties: "x,y"; } } Rectangle { diff --git a/tests/auto/declarative/layouts/data/horizontal-animated.qml b/tests/auto/declarative/layouts/data/horizontal-animated.qml index f757d18..c29d6df 100644 --- a/tests/auto/declarative/layouts/data/horizontal-animated.qml +++ b/tests/auto/declarative/layouts/data/horizontal-animated.qml @@ -6,17 +6,17 @@ Item { Row { add: Transition { NumberAnimation { - properties: "x"; from: -100 + matchProperties: "x"; from: -100 } } remove: Transition { NumberAnimation { - properties: "x"; to: -100 + matchProperties: "x"; to: -100 } } move: Transition { NumberAnimation { - properties: "x"; + matchProperties: "x"; } } Rectangle { diff --git a/tests/auto/declarative/layouts/data/vertical-animated.qml b/tests/auto/declarative/layouts/data/vertical-animated.qml index f52a78a..fcbc5f7 100644 --- a/tests/auto/declarative/layouts/data/vertical-animated.qml +++ b/tests/auto/declarative/layouts/data/vertical-animated.qml @@ -6,17 +6,17 @@ Item { Column { add: Transition { NumberAnimation { - properties: "y"; from: -100 + matchProperties: "y"; from: -100 } } remove: Transition { NumberAnimation { - properties: "y"; to: -100 + matchProperties: "y"; to: -100 } } move: Transition { NumberAnimation { - properties: "y"; + matchProperties: "y"; } } Rectangle { diff --git a/tests/auto/declarative/visual/bindinganimation/bindinganimation.qml b/tests/auto/declarative/visual/bindinganimation/bindinganimation.qml index 90ef1e5..efbb1b4 100644 --- a/tests/auto/declarative/visual/bindinganimation/bindinganimation.qml +++ b/tests/auto/declarative/visual/bindinganimation/bindinganimation.qml @@ -28,7 +28,7 @@ Rectangle { transitions: [ Transition { NumberAnimation { - properties: "x" + matchProperties: "x" } } ] diff --git a/tests/auto/declarative/visual/easing/easing.qml b/tests/auto/declarative/visual/easing/easing.qml index f81400b..1e8e907 100644 --- a/tests/auto/declarative/visual/easing/easing.qml +++ b/tests/auto/declarative/visual/easing/easing.qml @@ -176,7 +176,7 @@ Rectangle { to: "to" reversible: true NumberAnimation { - properties: "x" + matchProperties: "x" easing: type duration: 1000 } |