summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-11-10 05:17:20 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-11-10 05:17:20 (GMT)
commita1080b89abad16d3889211bae2b1f99891a7dbfe (patch)
tree58831dfa2c06bf11b3374cbdc2fc910e7d03b8e1 /examples
parent6ac64e4b8d7cb86394936a4d5723625bcabf2f59 (diff)
parentd99decf13bc35d0eb8e9da3ccc828a4a947d7dad (diff)
downloadQt-a1080b89abad16d3889211bae2b1f99891a7dbfe.zip
Qt-a1080b89abad16d3889211bae2b1f99891a7dbfe.tar.gz
Qt-a1080b89abad16d3889211bae2b1f99891a7dbfe.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'examples')
-rw-r--r--examples/declarative/layouts/positioners.qml40
-rw-r--r--examples/declarative/tutorials/samegame/samegame3/samegame.js24
2 files changed, 33 insertions, 31 deletions
diff --git a/examples/declarative/layouts/positioners.qml b/examples/declarative/layouts/positioners.qml
index 129effe..e912632 100644
--- a/examples/declarative/layouts/positioners.qml
+++ b/examples/declarative/layouts/positioners.qml
@@ -25,9 +25,13 @@ Rectangle {
}
}
Rectangle { color: "red"; width: 100; height: 50; border.color: "black"; radius: 15 }
- Rectangle { id: blueV1; color: "lightsteelblue"; width: 100; height: 50; border.color: "black"; radius: 15 }
+ Rectangle { id: blueV1; color: "lightsteelblue"; width: 100; height: 50; border.color: "black"; radius: 15
+ opacity: Behavior{NumberAnimation{}}
+ }
Rectangle { color: "green"; width: 100; height: 50; border.color: "black"; radius: 15 }
- Rectangle { id: blueV2; color: "lightsteelblue"; width: 100; height: 50; border.color: "black"; radius: 15 }
+ Rectangle { id: blueV2; color: "lightsteelblue"; width: 100; height: 50; border.color: "black"; radius: 15
+ opacity: Behavior{NumberAnimation{}}
+ }
Rectangle { color: "orange"; width: 100; height: 50; border.color: "black"; radius: 15 }
}
@@ -43,22 +47,20 @@ Rectangle {
NumberAnimation {
matchProperties: "x"; from: 500; duration:500; easing: "easeOutQuad"
}
- NumberAnimation {
- matchProperties: "opacity"; from: 0; duration: 500;
- }
}
remove: Transition {
NumberAnimation {
matchProperties: "x"; to: 500; duration:500; easing: "easeInQuad"
}
- NumberAnimation {
- matchProperties: "opacity"; from: 1; duration: 500
- }
}
Rectangle { color: "red"; width: 50; height: 100; border.color: "black"; radius: 15 }
- Rectangle { id: blueH1; color: "lightsteelblue"; width: 50; height: 100; border.color: "black"; radius: 15 }
+ Rectangle { id: blueH1; color: "lightsteelblue"; width: 50; height: 100; border.color: "black"; radius: 15
+ opacity: Behavior{NumberAnimation{}}
+ }
Rectangle { color: "green"; width: 50; height: 100; border.color: "black"; radius: 15 }
- Rectangle { id: blueH2; color: "lightsteelblue"; width: 50; height: 100; border.color: "black"; radius: 15 }
+ Rectangle { id: blueH2; color: "lightsteelblue"; width: 50; height: 100; border.color: "black"; radius: 15
+ opacity: Behavior{NumberAnimation{}}
+ }
Rectangle { color: "orange"; width: 50; height: 100; border.color: "black"; radius: 15 }
}
@@ -103,9 +105,6 @@ Rectangle {
remove: Transition {
NumberAnimation {
- matchProperties: "opacity"; from: 1; to: 0; duration: 500
- }
- NumberAnimation {
matchProperties: "x,y"; easing: "easeOutBounce"
}
}
@@ -118,19 +117,22 @@ Rectangle {
add: Transition {
NumberAnimation {
- matchProperties: "opacity"; from: 0; to: 1; duration: 500
- }
- NumberAnimation {
matchProperties: "x,y"; easing: "easeOutBounce"
}
}
Rectangle { color: "red"; width: 50; height: 100; border.color: "black"; radius: 15 }
- Rectangle { id: blueG1; color: "lightsteelblue"; width: 50; height: 100; border.color: "black"; radius: 15 }
+ Rectangle { id: blueG1; color: "lightsteelblue"; width: 50; height: 100; border.color: "black"; radius: 15
+ opacity: Behavior{NumberAnimation{}}
+ }
Rectangle { color: "green"; width: 50; height: 100; border.color: "black"; radius: 15 }
- Rectangle { id: blueG2; color: "lightsteelblue"; width: 50; height: 100; border.color: "black"; radius: 15 }
+ Rectangle { id: blueG2; color: "lightsteelblue"; width: 50; height: 100; border.color: "black"; radius: 15
+ opacity: Behavior{NumberAnimation{}}
+ }
Rectangle { color: "orange"; width: 50; height: 100; border.color: "black"; radius: 15 }
- Rectangle { id: blueG3; color: "lightsteelblue"; width: 50; height: 100; border.color: "black"; radius: 15 }
+ Rectangle { id: blueG3; color: "lightsteelblue"; width: 50; height: 100; border.color: "black"; radius: 15
+ opacity: Behavior{NumberAnimation{}}
+ }
Rectangle { color: "red"; width: 50; height: 100; border.color: "black"; radius: 15 }
Rectangle { color: "green"; width: 50; height: 100; border.color: "black"; radius: 15 }
Rectangle { color: "orange"; width: 50; height: 100; border.color: "black"; radius: 15 }
diff --git a/examples/declarative/tutorials/samegame/samegame3/samegame.js b/examples/declarative/tutorials/samegame/samegame3/samegame.js
index 528a73c..38efb3b 100644
--- a/examples/declarative/tutorials/samegame/samegame3/samegame.js
+++ b/examples/declarative/tutorials/samegame/samegame3/samegame.js
@@ -75,8 +75,8 @@ var floodBoard;//Set to 1 if the floodFill reaches off that node
//![1]
function handleClick(x,y)
{
- xIdx = Math.floor(x/gameCanvas.tileSize);
- yIdx = Math.floor(y/gameCanvas.tileSize);
+ var xIdx = Math.floor(x/gameCanvas.tileSize);
+ var yIdx = Math.floor(y/gameCanvas.tileSize);
if(xIdx >= maxX || xIdx < 0 || yIdx >= maxY || yIdx < 0)
return;
if(board[index(xIdx, yIdx)] == null)
@@ -124,13 +124,13 @@ function shuffleDown()
{
//Fall down
for(var xIdx=0; xIdx<maxX; xIdx++){
- fallDist = 0;
- for(yIdx=maxY-1; yIdx>=0; yIdx--){
+ var fallDist = 0;
+ for(var yIdx=maxY-1; yIdx>=0; yIdx--){
if(board[index(xIdx,yIdx)] == null){
fallDist += 1;
}else{
if(fallDist > 0){
- obj = board[index(xIdx,yIdx)];
+ var obj = board[index(xIdx,yIdx)];
obj.y += fallDist * gameCanvas.tileSize;
board[index(xIdx,yIdx+fallDist)] = obj;
board[index(xIdx,yIdx)] = null;
@@ -139,14 +139,14 @@ function shuffleDown()
}
}
//Fall to the left
- fallDist = 0;
- for(xIdx=0; xIdx<maxX; xIdx++){
+ var fallDist = 0;
+ for(var xIdx=0; xIdx<maxX; xIdx++){
if(board[index(xIdx, maxY - 1)] == null){
fallDist += 1;
}else{
if(fallDist > 0){
- for(yIdx=0; yIdx<maxY; yIdx++){
- obj = board[index(xIdx,yIdx)];
+ for(var yIdx=0; yIdx<maxY; yIdx++){
+ var obj = board[index(xIdx,yIdx)];
if(obj == null)
continue;
obj.x -= fallDist * gameCanvas.tileSize;
@@ -162,8 +162,8 @@ function shuffleDown()
function victoryCheck()
{
//awards bonuses for no tiles left
- deservesBonus = true;
- for(xIdx=maxX-1; xIdx>=0; xIdx--)
+ var deservesBonus = true;
+ for(var xIdx=maxX-1; xIdx>=0; xIdx--)
if(board[index(xIdx, maxY - 1)] != null)
deservesBonus = false;
if(deservesBonus)
@@ -181,7 +181,7 @@ function floodMoveCheck(xIdx, yIdx, type)
return false;
if(board[index(xIdx, yIdx)] == null)
return false;
- myType = board[index(xIdx, yIdx)].type;
+ var myType = board[index(xIdx, yIdx)].type;
if(type == myType)
return true;
return floodMoveCheck(xIdx + 1, yIdx, myType) ||