summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2009-11-06 03:49:33 (GMT)
committerMartin Jones <martin.jones@nokia.com>2009-11-06 03:49:33 (GMT)
commit8012351a8d978c4b97cf152672cda1e63b8024ac (patch)
tree74d94402e705d1e1bb4c4cbc43677ba183ddca78 /tests
parentb2f9f3f2157629eae2544cf6fa2215b26e4e5a84 (diff)
parentcd9f07d8c488ff35cceb73924af4da4bdc10a647 (diff)
downloadQt-8012351a8d978c4b97cf152672cda1e63b8024ac.zip
Qt-8012351a8d978c4b97cf152672cda1e63b8024ac.tar.gz
Qt-8012351a8d978c4b97cf152672cda1e63b8024ac.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/animations/data/badproperty1.qml2
-rw-r--r--tests/auto/declarative/animations/data/badtype4.qml4
-rw-r--r--tests/auto/declarative/animations/data/dotproperty.qml4
-rw-r--r--tests/auto/declarative/animations/data/mixedtype1.qml2
-rw-r--r--tests/auto/declarative/animations/data/mixedtype2.qml2
-rw-r--r--tests/auto/declarative/animations/data/properties.qml14
-rw-r--r--tests/auto/declarative/animations/data/properties2.qml14
-rw-r--r--tests/auto/declarative/animations/data/properties3.qml14
-rw-r--r--tests/auto/declarative/animations/data/properties4.qml14
-rw-r--r--tests/auto/declarative/animations/data/properties5.qml14
-rw-r--r--tests/auto/declarative/animations/data/propertiesTransition.qml29
-rw-r--r--tests/auto/declarative/animations/data/propertiesTransition2.qml29
-rw-r--r--tests/auto/declarative/animations/data/propertiesTransition3.qml29
-rw-r--r--tests/auto/declarative/animations/data/propertiesTransition4.qml29
-rw-r--r--tests/auto/declarative/animations/data/propertiesTransition5.qml29
-rw-r--r--tests/auto/declarative/animations/data/propertiesTransition6.qml29
-rw-r--r--tests/auto/declarative/animations/tst_animations.cpp144
-rw-r--r--tests/auto/declarative/behaviors/data/nonSelecting.qml2
-rw-r--r--tests/auto/declarative/behaviors/data/nonSelecting2.qml26
-rw-r--r--tests/auto/declarative/behaviors/tst_behaviors.cpp27
-rw-r--r--tests/auto/declarative/layouts/data/grid-animated.qml6
-rw-r--r--tests/auto/declarative/layouts/data/horizontal-animated.qml6
-rw-r--r--tests/auto/declarative/layouts/data/vertical-animated.qml6
-rw-r--r--tests/auto/declarative/visual/bindinganimation/bindinganimation.qml2
-rw-r--r--tests/auto/declarative/visual/easing/easing.qml2
25 files changed, 451 insertions, 28 deletions
diff --git a/tests/auto/declarative/animations/data/badproperty1.qml b/tests/auto/declarative/animations/data/badproperty1.qml
index 78da34a..df1a98d 100644
--- a/tests/auto/declarative/animations/data/badproperty1.qml
+++ b/tests/auto/declarative/animations/data/badproperty1.qml
@@ -19,6 +19,6 @@ Rectangle {
PropertyChanges { target: MyRect; border.color: "blue" }
}
transitions: Transition {
- ColorAnimation { target: MyRect; to: "red"; properties: "pen.colr"; duration: 1000 }
+ ColorAnimation { target: MyRect; to: "red"; property: "pen.colr"; duration: 1000 }
}
}
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/animations/data/properties.qml b/tests/auto/declarative/animations/data/properties.qml
new file mode 100644
index 0000000..a8023b4
--- /dev/null
+++ b/tests/auto/declarative/animations/data/properties.qml
@@ -0,0 +1,14 @@
+import Qt 4.6
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: theRect
+ objectName: "TheRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ x: NumberAnimation { to: 200; running: true; }
+ }
+}
diff --git a/tests/auto/declarative/animations/data/properties2.qml b/tests/auto/declarative/animations/data/properties2.qml
new file mode 100644
index 0000000..aab7661
--- /dev/null
+++ b/tests/auto/declarative/animations/data/properties2.qml
@@ -0,0 +1,14 @@
+import Qt 4.6
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: theRect
+ objectName: "TheRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ x: NumberAnimation { matchTargets: theRect; matchProperties: "x"; to: 200; running: true }
+ }
+}
diff --git a/tests/auto/declarative/animations/data/properties3.qml b/tests/auto/declarative/animations/data/properties3.qml
new file mode 100644
index 0000000..fd21a85
--- /dev/null
+++ b/tests/auto/declarative/animations/data/properties3.qml
@@ -0,0 +1,14 @@
+import Qt 4.6
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: theRect
+ objectName: "TheRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ x: NumberAnimation { target: theRect; property: "x"; to: 300; running: true }
+ }
+}
diff --git a/tests/auto/declarative/animations/data/properties4.qml b/tests/auto/declarative/animations/data/properties4.qml
new file mode 100644
index 0000000..e23651c
--- /dev/null
+++ b/tests/auto/declarative/animations/data/properties4.qml
@@ -0,0 +1,14 @@
+import Qt 4.6
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: theRect
+ objectName: "TheRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ x: NumberAnimation { target: theRect; property: "y"; to: 200; running: true }
+ }
+}
diff --git a/tests/auto/declarative/animations/data/properties5.qml b/tests/auto/declarative/animations/data/properties5.qml
new file mode 100644
index 0000000..25c9866
--- /dev/null
+++ b/tests/auto/declarative/animations/data/properties5.qml
@@ -0,0 +1,14 @@
+import Qt 4.6
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: theRect
+ objectName: "TheRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ x: NumberAnimation { matchTargets: theRect; matchProperties: "y"; to: 200; running: true }
+ }
+}
diff --git a/tests/auto/declarative/animations/data/propertiesTransition.qml b/tests/auto/declarative/animations/data/propertiesTransition.qml
new file mode 100644
index 0000000..75603b9
--- /dev/null
+++ b/tests/auto/declarative/animations/data/propertiesTransition.qml
@@ -0,0 +1,29 @@
+import Qt 4.6
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: theRect
+ objectName: "TheRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ }
+
+ states: State {
+ name: "moved"
+ PropertyChanges {
+ target: theRect
+ x: 200
+ }
+ }
+ transitions: Transition {
+ NumberAnimation { matchTargets: theRect; matchProperties: "x" }
+ }
+
+ MouseRegion {
+ anchors.fill: parent
+ onClicked: parent.state = "moved"
+ }
+}
diff --git a/tests/auto/declarative/animations/data/propertiesTransition2.qml b/tests/auto/declarative/animations/data/propertiesTransition2.qml
new file mode 100644
index 0000000..ae59157
--- /dev/null
+++ b/tests/auto/declarative/animations/data/propertiesTransition2.qml
@@ -0,0 +1,29 @@
+import Qt 4.6
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: theRect
+ objectName: "TheRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ }
+
+ states: State {
+ name: "moved"
+ PropertyChanges {
+ target: theRect
+ x: 200
+ }
+ }
+ transitions: Transition {
+ NumberAnimation { target: theRect; property: "y"; to: 200 }
+ }
+
+ MouseRegion {
+ anchors.fill: parent
+ onClicked: parent.state = "moved"
+ }
+}
diff --git a/tests/auto/declarative/animations/data/propertiesTransition3.qml b/tests/auto/declarative/animations/data/propertiesTransition3.qml
new file mode 100644
index 0000000..eedba7b
--- /dev/null
+++ b/tests/auto/declarative/animations/data/propertiesTransition3.qml
@@ -0,0 +1,29 @@
+import Qt 4.6
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: theRect
+ objectName: "TheRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ }
+
+ states: State {
+ name: "moved"
+ PropertyChanges {
+ target: theRect
+ x: 200
+ }
+ }
+ transitions: Transition {
+ NumberAnimation { matchTargets: theRect; matchProperties: "y" }
+ }
+
+ MouseRegion {
+ anchors.fill: parent
+ onClicked: parent.state = "moved"
+ }
+}
diff --git a/tests/auto/declarative/animations/data/propertiesTransition4.qml b/tests/auto/declarative/animations/data/propertiesTransition4.qml
new file mode 100644
index 0000000..301f796
--- /dev/null
+++ b/tests/auto/declarative/animations/data/propertiesTransition4.qml
@@ -0,0 +1,29 @@
+import Qt 4.6
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: theRect
+ objectName: "TheRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ }
+
+ states: State {
+ name: "moved"
+ PropertyChanges {
+ target: theRect
+ x: 200
+ }
+ }
+ transitions: Transition {
+ NumberAnimation { target: theRect; matchProperties: "x" }
+ }
+
+ MouseRegion {
+ anchors.fill: parent
+ onClicked: parent.state = "moved"
+ }
+}
diff --git a/tests/auto/declarative/animations/data/propertiesTransition5.qml b/tests/auto/declarative/animations/data/propertiesTransition5.qml
new file mode 100644
index 0000000..565c519
--- /dev/null
+++ b/tests/auto/declarative/animations/data/propertiesTransition5.qml
@@ -0,0 +1,29 @@
+import Qt 4.6
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: theRect
+ objectName: "TheRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ }
+
+ states: State {
+ name: "moved"
+ PropertyChanges {
+ target: theRect
+ x: 200
+ }
+ }
+ transitions: Transition {
+ NumberAnimation { matchTargets: theRect; property: "x" }
+ }
+
+ MouseRegion {
+ anchors.fill: parent
+ onClicked: parent.state = "moved"
+ }
+}
diff --git a/tests/auto/declarative/animations/data/propertiesTransition6.qml b/tests/auto/declarative/animations/data/propertiesTransition6.qml
new file mode 100644
index 0000000..b541dab
--- /dev/null
+++ b/tests/auto/declarative/animations/data/propertiesTransition6.qml
@@ -0,0 +1,29 @@
+import Qt 4.6
+
+Rectangle {
+ width: 400
+ height: 400
+ Rectangle {
+ id: theRect
+ objectName: "TheRect"
+ color: "red"
+ width: 50; height: 50
+ x: 100; y: 100
+ }
+
+ states: State {
+ name: "moved"
+ PropertyChanges {
+ target: theRect
+ x: 200
+ }
+ }
+ transitions: Transition {
+ NumberAnimation { matchTargets: theItem; matchProperties: "x" }
+ }
+
+ MouseRegion {
+ anchors.fill: parent
+ onClicked: parent.state = "moved"
+ }
+}
diff --git a/tests/auto/declarative/animations/tst_animations.cpp b/tests/auto/declarative/animations/tst_animations.cpp
index ca383bb..a4402cb 100644
--- a/tests/auto/declarative/animations/tst_animations.cpp
+++ b/tests/auto/declarative/animations/tst_animations.cpp
@@ -59,6 +59,8 @@ private slots:
void badTypes();
void badProperties();
void mixedTypes();
+ void properties();
+ void propertiesTransition();
};
#define QTIMED_COMPARE(lhs, rhs) do { \
@@ -198,11 +200,12 @@ void tst_animations::badProperties()
{
QmlEngine engine;
QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/badproperty1.qml"));
+ QTest::ignoreMessage(QtWarningMsg, "QML QmlColorAnimation (file://" SRCDIR "/data/badproperty1.qml:22:9) Cannot animate non-existant property \"pen.colr\"");
QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(c.create());
QVERIFY(rect);
- QTest::ignoreMessage(QtWarningMsg, "QML QmlColorAnimation (file://" SRCDIR "/data/badproperty1.qml:22:9) Cannot animate non-existant property \"pen.colr\"");
- rect->setState("state1");
+ //### should we warn here are well?
+ //rect->setState("state1");
}
}
@@ -244,6 +247,143 @@ void tst_animations::mixedTypes()
}
}
+void tst_animations::properties()
+{
+ const int waitDuration = 300;
+ {
+ QmlEngine engine;
+ QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/properties.qml"));
+ QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QmlGraphicsRectangle *myRect = rect->findChild<QmlGraphicsRectangle*>("TheRect");
+ QVERIFY(myRect);
+ QTest::qWait(waitDuration);
+ QTIMED_COMPARE(myRect->x(),qreal(200));
+ }
+
+ {
+ QmlEngine engine;
+ QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/properties2.qml"));
+ QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QmlGraphicsRectangle *myRect = rect->findChild<QmlGraphicsRectangle*>("TheRect");
+ QVERIFY(myRect);
+ QTest::qWait(waitDuration);
+ QTIMED_COMPARE(myRect->x(),qreal(200));
+ }
+
+ {
+ QmlEngine engine;
+ QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/properties3.qml"));
+ QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QmlGraphicsRectangle *myRect = rect->findChild<QmlGraphicsRectangle*>("TheRect");
+ QVERIFY(myRect);
+ QTest::qWait(waitDuration);
+ QTIMED_COMPARE(myRect->x(),qreal(300));
+ }
+
+ {
+ QmlEngine engine;
+ QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/properties4.qml"));
+ QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QmlGraphicsRectangle *myRect = rect->findChild<QmlGraphicsRectangle*>("TheRect");
+ QVERIFY(myRect);
+ QTest::qWait(waitDuration);
+ QTIMED_COMPARE(myRect->y(),qreal(200));
+ QTIMED_COMPARE(myRect->x(),qreal(100));
+ }
+
+ {
+ QmlEngine engine;
+ QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/properties5.qml"));
+ QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QmlGraphicsRectangle *myRect = rect->findChild<QmlGraphicsRectangle*>("TheRect");
+ QVERIFY(myRect);
+ QTest::qWait(waitDuration);
+ QTIMED_COMPARE(myRect->x(),qreal(100));
+ QTIMED_COMPARE(myRect->y(),qreal(100));
+ }
+}
+
+void tst_animations::propertiesTransition()
+{
+ const int waitDuration = 300;
+ {
+ QmlEngine engine;
+ QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/propertiesTransition.qml"));
+ QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(c.create());
+ QVERIFY(rect);
+
+ rect->setState("moved");
+ QmlGraphicsRectangle *myRect = rect->findChild<QmlGraphicsRectangle*>("TheRect");
+ QVERIFY(myRect);
+ QTest::qWait(waitDuration);
+ QTIMED_COMPARE(myRect->x(),qreal(200));
+ }
+
+ {
+ QmlEngine engine;
+ QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/propertiesTransition2.qml"));
+ QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QmlGraphicsRectangle *myRect = rect->findChild<QmlGraphicsRectangle*>("TheRect");
+ QVERIFY(myRect);
+ rect->setState("moved");
+ QCOMPARE(myRect->x(),qreal(200));
+ QCOMPARE(myRect->y(),qreal(100));
+ QTest::qWait(waitDuration);
+ QTIMED_COMPARE(myRect->y(),qreal(200));
+ }
+
+ {
+ QmlEngine engine;
+ QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/propertiesTransition3.qml"));
+ QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QmlGraphicsRectangle *myRect = rect->findChild<QmlGraphicsRectangle*>("TheRect");
+ QVERIFY(myRect);
+ QTest::ignoreMessage(QtWarningMsg, "QML QmlNumberAnimation (file:///home/brasser/depot/kinetic-declarativeui/qt/tests/auto/declarative/animations/data/propertiesTransition4.qml:22:9) targets/properties/exclude and target/property are mutually exclusive.");
+ rect->setState("moved");
+ QCOMPARE(myRect->x(),qreal(200));
+ }
+
+ {
+ QmlEngine engine;
+ QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/propertiesTransition4.qml"));
+ QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(c.create());
+ QVERIFY(rect);
+
+ QmlGraphicsRectangle *myRect = rect->findChild<QmlGraphicsRectangle*>("TheRect");
+ QVERIFY(myRect);
+ QTest::ignoreMessage(QtWarningMsg, "QML QmlNumberAnimation (file:///home/brasser/depot/kinetic-declarativeui/qt/tests/auto/declarative/animations/data/propertiesTransition5.qml:22:9) targets/properties/exclude and target/property are mutually exclusive.");
+ rect->setState("moved");
+ QCOMPARE(myRect->x(),qreal(200));
+ }
+
+ {
+ QmlEngine engine;
+ QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/propertiesTransition5.qml"));
+ QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(c.create());
+ QVERIFY(rect);
+
+ //### should output warning at some point -- theItem doesn't exist
+ QmlGraphicsRectangle *myRect = rect->findChild<QmlGraphicsRectangle*>("TheRect");
+ QVERIFY(myRect);
+ rect->setState("moved");
+ QCOMPARE(myRect->x(),qreal(200));
+ }
+}
+
QTEST_MAIN(tst_animations)
#include "tst_animations.moc"
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
}