diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-03-02 00:47:10 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-03-02 00:47:10 (GMT) |
commit | 2790cb59f6877c1027c833578b72e168c912758a (patch) | |
tree | b626316b5801ba887b48e9fe71f811f4cf4ec581 /demos/declarative/snake | |
parent | f800919c4336da77b73561cc5180fc167f61f435 (diff) | |
download | Qt-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 'demos/declarative/snake')
-rw-r--r-- | demos/declarative/snake/content/Cookie.qml | 2 | ||||
-rw-r--r-- | demos/declarative/snake/content/Link.qml | 8 | ||||
-rw-r--r-- | demos/declarative/snake/content/Skull.qml | 6 | ||||
-rw-r--r-- | demos/declarative/snake/content/snake.js | 4 | ||||
-rw-r--r-- | demos/declarative/snake/snake.qml | 6 |
5 files changed, 13 insertions, 13 deletions
diff --git a/demos/declarative/snake/content/Cookie.qml b/demos/declarative/snake/content/Cookie.qml index 7f0aadf..0ea95cb 100644 --- a/demos/declarative/snake/content/Cookie.qml +++ b/demos/declarative/snake/content/Cookie.qml @@ -17,7 +17,7 @@ Item { anchors.fill: parent source: "pics/cookie.png" opacity: 0 - opacity: Behavior { NumberAnimation { duration: 100 } } + Behavior on opacity { NumberAnimation { duration: 100 } } Text { font.bold: true anchors.verticalCenter: parent.verticalCenter diff --git a/demos/declarative/snake/content/Link.qml b/demos/declarative/snake/content/Link.qml index 1b3f7bf..31ac4b9 100644 --- a/demos/declarative/snake/content/Link.qml +++ b/demos/declarative/snake/content/Link.qml @@ -13,8 +13,8 @@ Item { id:link x: margin - 3 + gridSize * column y: margin - 3 + gridSize * row - x: Behavior { NumberAnimation { duration: spawned ? heartbeatInterval : 0} } - y: Behavior { NumberAnimation { duration: spawned ? heartbeatInterval : 0 } } + Behavior on x { NumberAnimation { duration: spawned ? heartbeatInterval : 0} } + Behavior on y { NumberAnimation { duration: spawned ? heartbeatInterval : 0 } } Item { @@ -35,7 +35,7 @@ Item { id:link id: actualImageRotation origin.x: width/2; origin.y: height/2; angle: rotation * 90 - angle: Behavior{ NumberAnimation { duration: spawned ? 200 : 0} } + Behavior on angle { NumberAnimation { duration: spawned ? 200 : 0} } } } @@ -44,7 +44,7 @@ Item { id:link } opacity: 0 - opacity: Behavior { NumberAnimation { duration: 200 } } + Behavior on opacity { NumberAnimation { duration: 200 } } } diff --git a/demos/declarative/snake/content/Skull.qml b/demos/declarative/snake/content/Skull.qml index 585e7d3..821996a 100644 --- a/demos/declarative/snake/content/Skull.qml +++ b/demos/declarative/snake/content/Skull.qml @@ -9,11 +9,11 @@ Image { x: margin + column * gridSize + 2 y: margin + row * gridSize - 3 - x: Behavior { NumberAnimation { duration: spawned ? halfbeatInterval : 0} } - y: Behavior { NumberAnimation { duration: spawned ? halfbeatInterval : 0 } } + Behavior on x { NumberAnimation { duration: spawned ? halfbeatInterval : 0} } + Behavior on y { NumberAnimation { duration: spawned ? halfbeatInterval : 0 } } opacity: spawned ? 1 : 0 - opacity: Behavior { NumberAnimation { duration: 200 } } + Behavior on opacity { NumberAnimation { duration: 200 } } source: "pics/skull.png" width: 24 diff --git a/demos/declarative/snake/content/snake.js b/demos/declarative/snake/content/snake.js index a65aebc..12176c7 100644 --- a/demos/declarative/snake/content/snake.js +++ b/demos/declarative/snake/content/snake.js @@ -54,7 +54,7 @@ function startNewGame() } else { if(linkComponent.isReady == false){ if(linkComponent.isError == true) - print(linkComponent.errorString()); + print(linkComponent.errorsString()); else print("Still loading linkComponent"); continue;//TODO: Better error handling? @@ -295,7 +295,7 @@ function createCookie(value) { if(cookieComponent.isReady == false){ if(cookieComponent.isError == true) - print(cookieComponent.errorString()); + print(cookieComponent.errorsString()); else print("Still loading cookieComponent"); return;//TODO: Better error handling? diff --git a/demos/declarative/snake/snake.qml b/demos/declarative/snake/snake.qml index 09b6b7f..f9d02c7 100644 --- a/demos/declarative/snake/snake.qml +++ b/demos/declarative/snake/snake.qml @@ -65,7 +65,7 @@ Rectangle { anchors.fill: parent anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter - opacity: Behavior { NumberAnimation { duration: 500 } } + Behavior on opacity { NumberAnimation { duration: 500 } } Text { color: "white" @@ -121,7 +121,7 @@ Rectangle { Rectangle { id: progressBar opacity: 0 - opacity: Behavior { NumberAnimation { duration: 200 } } + Behavior on opacity { NumberAnimation { duration: 200 } } color: "transparent" border.width: 2 border.color: "#221edd" @@ -137,7 +137,7 @@ Rectangle { id: progressIndicator color: "#221edd"; width: 0; - width: Behavior { NumberAnimation { duration: startHeartbeatTimer.running ? 1000 : 0}} + Behavior on width { NumberAnimation { duration: startHeartbeatTimer.running ? 1000 : 0}} height: 30; } } |