summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativebehaviors
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2010-03-02 00:47:10 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2010-03-02 00:47:10 (GMT)
commit2790cb59f6877c1027c833578b72e168c912758a (patch)
treeb626316b5801ba887b48e9fe71f811f4cf4ec581 /tests/auto/declarative/qdeclarativebehaviors
parentf800919c4336da77b73561cc5180fc167f61f435 (diff)
downloadQt-2790cb59f6877c1027c833578b72e168c912758a.zip
Qt-2790cb59f6877c1027c833578b72e168c912758a.tar.gz
Qt-2790cb59f6877c1027c833578b72e168c912758a.tar.bz2
Make "on" syntax mandatory for value sources and interceptors
Where you would have written x: NumberAnimation {} y: Behavior {} you now must write NumberAnimation on x {} Behavior on y {} This change also makes the parser more strict with respect to multiple assignments to a single property - they're no longer allowed. For example this x: 10 x: 11 is now an error.
Diffstat (limited to 'tests/auto/declarative/qdeclarativebehaviors')
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/binding.qml2
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/color.qml2
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/cpptrigger.qml2
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/disabled.qml2
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/dontStart.qml2
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/empty.qml2
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/explicit.qml2
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/groupProperty.qml2
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/groupProperty2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/loop.qml2
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/nonSelecting2.qml2
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/parent.qml2
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/reassignedAnimation.qml2
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/scripttrigger.qml2
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/data/simple.qml2
-rw-r--r--tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp2
16 files changed, 16 insertions, 16 deletions
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/binding.qml b/tests/auto/declarative/qdeclarativebehaviors/data/binding.qml
index 201da37..e982f21 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/data/binding.qml
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/binding.qml
@@ -9,7 +9,7 @@ Rectangle {
objectName: "MyRect"
width: 100; height: 100; color: "green"
x: basex
- x: Behavior { NumberAnimation { duration: 500; } }
+ Behavior on x { NumberAnimation { duration: 500; } }
}
MouseArea {
id: clicker
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/color.qml b/tests/auto/declarative/qdeclarativebehaviors/data/color.qml
index 91dbbd1..f2f4742 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/data/color.qml
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/color.qml
@@ -7,7 +7,7 @@ Rectangle {
objectName: "MyRect"
width: 100; height: 100;
color: "green"
- color: Behavior { ColorAnimation { duration: 500; } }
+ Behavior on color { ColorAnimation { duration: 500; } }
}
MouseArea {
id: clicker
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/cpptrigger.qml b/tests/auto/declarative/qdeclarativebehaviors/data/cpptrigger.qml
index 8d032f0..3ea9376 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/data/cpptrigger.qml
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/cpptrigger.qml
@@ -6,6 +6,6 @@ Rectangle {
id: rect
objectName: "MyRect"
width: 100; height: 100; color: "green"
- x: Behavior { NumberAnimation { duration: 500; } }
+ Behavior on x { NumberAnimation { duration: 500; } }
}
}
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/disabled.qml b/tests/auto/declarative/qdeclarativebehaviors/data/disabled.qml
index 3c7078a..1403eb9 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/data/disabled.qml
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/disabled.qml
@@ -6,7 +6,7 @@ Rectangle {
id: rect
objectName: "MyRect"
width: 100; height: 100; color: "green"
- x: Behavior {
+ Behavior on x {
objectName: "MyBehavior";
enabled: false
NumberAnimation { duration: 200; }
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/dontStart.qml b/tests/auto/declarative/qdeclarativebehaviors/data/dontStart.qml
index ba7cc9c..12b1b7b 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/data/dontStart.qml
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/dontStart.qml
@@ -9,7 +9,7 @@ Rectangle {
id: redRect
width: 100; height: 100
color: Qt.rgba(1,0,0)
- x: Behavior {
+ Behavior on x {
NumberAnimation { objectName: "MyAnim"; running: true }
}
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/empty.qml b/tests/auto/declarative/qdeclarativebehaviors/data/empty.qml
index 95d934a..5e30f03 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/data/empty.qml
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/empty.qml
@@ -6,7 +6,7 @@ Rectangle {
id: rect
objectName: "MyRect"
width: 100; height: 100; color: "green"
- x: Behavior {}
+ Behavior on x {}
}
MouseArea {
id: clicker
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/explicit.qml b/tests/auto/declarative/qdeclarativebehaviors/data/explicit.qml
index 1b2025a..ca0ea54 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/data/explicit.qml
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/explicit.qml
@@ -6,7 +6,7 @@ Rectangle {
id: rect
objectName: "MyRect"
width: 100; height: 100; color: "green"
- x: Behavior {
+ Behavior on x {
objectName: "MyBehavior";
NumberAnimation { target: rect; property: "x"; duration: 500; }
}
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/groupProperty.qml b/tests/auto/declarative/qdeclarativebehaviors/data/groupProperty.qml
index 14883d4..a6c4ed9 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/data/groupProperty.qml
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/groupProperty.qml
@@ -6,7 +6,7 @@ Rectangle {
id: rect
objectName: "MyRect"
width: 100; height: 100; color: "green"
- pos: Behavior { PropertyAnimation { duration: 500; } }
+ Behavior on pos { PropertyAnimation { duration: 500; } }
}
MouseArea {
id: clicker
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/groupProperty2.qml b/tests/auto/declarative/qdeclarativebehaviors/data/groupProperty2.qml
index b43ddbc..2dda220 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/data/groupProperty2.qml
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/groupProperty2.qml
@@ -6,7 +6,7 @@ Rectangle {
id: rect
objectName: "MyRect"
width: 100; height: 100; color: "green"
- pos.x: Behavior { NumberAnimation { duration: 500; } }
+ Behavior on pos.x { NumberAnimation { duration: 500; } }
}
MouseArea {
id: clicker
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/loop.qml b/tests/auto/declarative/qdeclarativebehaviors/data/loop.qml
index 5f2c057..6187768 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/data/loop.qml
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/loop.qml
@@ -6,7 +6,7 @@ Rectangle {
id: rect
objectName: "MyRect"
width: 100; height: 100; color: "green"
- x: Behavior { NumberAnimation { duration: 200; } }
+ Behavior on x { NumberAnimation { duration: 200; } }
onXChanged: x = 100;
}
states: State {
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/nonSelecting2.qml b/tests/auto/declarative/qdeclarativebehaviors/data/nonSelecting2.qml
index f267a05..640a7d1 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/data/nonSelecting2.qml
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/nonSelecting2.qml
@@ -6,7 +6,7 @@ Rectangle {
id: rect
objectName: "MyRect"
width: 100; height: 100; color: "green"
- x: Behavior {
+ Behavior on x {
objectName: "MyBehavior";
NumberAnimation { targets: rect; properties: "y"; duration: 200; }
}
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/parent.qml b/tests/auto/declarative/qdeclarativebehaviors/data/parent.qml
index 7c7fdcb..3860ec7 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/data/parent.qml
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/parent.qml
@@ -6,7 +6,7 @@ Rectangle {
id: rect
objectName: "MyRect"
width: 100; height: 100; color: "green"
- parent: Behavior {
+ Behavior on parent {
SequentialAnimation {
PauseAnimation { duration: 500 }
PropertyAction {}
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/reassignedAnimation.qml b/tests/auto/declarative/qdeclarativebehaviors/data/reassignedAnimation.qml
index ba744b1..6419a6b 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/data/reassignedAnimation.qml
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/reassignedAnimation.qml
@@ -6,7 +6,7 @@ Rectangle {
id: rect
objectName: "MyRect"
width: 100; height: 100; color: "green"
- x: Behavior {
+ Behavior on x {
objectName: "MyBehavior"
NumberAnimation { duration: 200 }
NumberAnimation { duration: 1000 }
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/scripttrigger.qml b/tests/auto/declarative/qdeclarativebehaviors/data/scripttrigger.qml
index a91ca88..b22441a 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/data/scripttrigger.qml
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/scripttrigger.qml
@@ -11,6 +11,6 @@ Rectangle {
id: rect
objectName: "MyRect"
width: 100; height: 100; color: "green"
- x: Behavior { NumberAnimation { duration: 500; } }
+ Behavior on x { NumberAnimation { duration: 500; } }
}
}
diff --git a/tests/auto/declarative/qdeclarativebehaviors/data/simple.qml b/tests/auto/declarative/qdeclarativebehaviors/data/simple.qml
index ac98ed0..c28fa9a 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/data/simple.qml
+++ b/tests/auto/declarative/qdeclarativebehaviors/data/simple.qml
@@ -6,7 +6,7 @@ Rectangle {
id: rect
objectName: "MyRect"
width: 100; height: 100; color: "green"
- x: Behavior {
+ Behavior on x {
objectName: "MyBehavior";
NumberAnimation { duration: 500; }
}
diff --git a/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp b/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp
index f87330d..0bf0b81 100644
--- a/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp
+++ b/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp
@@ -260,7 +260,7 @@ void tst_qdeclarativebehaviors::reassignedAnimation()
{
QDeclarativeEngine engine;
QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/reassignedAnimation.qml"));
- QTest::ignoreMessage(QtWarningMsg, QString("QML Behavior (" + QUrl::fromLocalFile(SRCDIR "/data/reassignedAnimation.qml").toString() + ":9:12) Cannot change the animation assigned to a Behavior.").toUtf8().constData());
+ QTest::ignoreMessage(QtWarningMsg, QString("QML Behavior (" + QUrl::fromLocalFile(SRCDIR "/data/reassignedAnimation.qml").toString() + ":9:9) Cannot change the animation assigned to a Behavior.").toUtf8().constData());
QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(c.create());
QVERIFY(rect);
QCOMPARE(qobject_cast<QDeclarativeNumberAnimation*>(