summaryrefslogtreecommitdiffstats
path: root/examples/declarative/follow
diff options
context:
space:
mode:
Diffstat (limited to 'examples/declarative/follow')
-rw-r--r--examples/declarative/follow/follow.qml12
-rw-r--r--examples/declarative/follow/pong.qml18
2 files changed, 15 insertions, 15 deletions
diff --git a/examples/declarative/follow/follow.qml b/examples/declarative/follow/follow.qml
index 59561b3..90bd7c8 100644
--- a/examples/declarative/follow/follow.qml
+++ b/examples/declarative/follow/follow.qml
@@ -1,9 +1,9 @@
import Qt 4.6
-Rect {
+Rectangle {
color: "#ffffff"
width: 320; height: 240
- Rect {
+ Rectangle {
id: Rect
color: "#00ff00"
y: 200; width: 60; height: 20
@@ -22,7 +22,7 @@ Rect {
}
// Velocity
- Rect {
+ Rectangle {
color: "#ff0000"
x: Rect.width; width: Rect.width; height: 20
y: 200
@@ -31,13 +31,13 @@ Rect {
Text { x: Rect.width; y: 220; text: "Velocity" }
// Spring
- Rect {
+ Rectangle {
color: "#ff0000"
x: Rect.width * 2; width: Rect.width/2; height: 20
y: 200
y: Follow { source: Rect.y; spring: 1.0; damping: 0.2 }
}
- Rect {
+ Rectangle {
color: "#880000"
x: Rect.width * 2.5; width: Rect.width/2; height: 20
y: 200
@@ -49,7 +49,7 @@ Rect {
MouseRegion {
id: Mouse
anchors.fill: parent
- Rect {
+ Rectangle {
id: "Ball"
width: 20; height: 20
radius: 10
diff --git a/examples/declarative/follow/pong.qml b/examples/declarative/follow/pong.qml
index 2a430bf..6146f1a 100644
--- a/examples/declarative/follow/pong.qml
+++ b/examples/declarative/follow/pong.qml
@@ -1,12 +1,12 @@
import Qt 4.6
-Rect {
+Rectangle {
id: Page
width: 640; height: 480
color: "#000000"
// Make a ball to bounce
- Rect {
+ Rectangle {
// Add a property for the target y coordinate
property var targetY : Page.height-10
property var direction : "right"
@@ -38,7 +38,7 @@ Rect {
// Place bats to the left and right of the view, following the y
// coordinates of the ball.
- Rect {
+ Rectangle {
id: LeftBat
color: "#00ee00"
x: 2; width: 20; height: 90
@@ -47,7 +47,7 @@ Rect {
enabled: Ball.direction == 'left'
}
}
- Rect {
+ Rectangle {
id: RightBat
color: "#00ee00"
x: Page.width-22; width: 20; height: 90
@@ -58,12 +58,12 @@ Rect {
}
// The rest, to make it look realistic, if neither ever scores...
- Rect { color: "#00ee00"; x: Page.width/2-80; y: 0; width: 40; height: 60 }
- Rect { color: "#000000"; x: Page.width/2-70; y: 10; width: 20; height: 40 }
- Rect { color: "#00ee00"; x: Page.width/2+40; y: 0; width: 40; height: 60 }
- Rect { color: "#000000"; x: Page.width/2+50; y: 10; width: 20; height: 40 }
+ Rectangle { color: "#00ee00"; x: Page.width/2-80; y: 0; width: 40; height: 60 }
+ Rectangle { color: "#000000"; x: Page.width/2-70; y: 10; width: 20; height: 40 }
+ Rectangle { color: "#00ee00"; x: Page.width/2+40; y: 0; width: 40; height: 60 }
+ Rectangle { color: "#000000"; x: Page.width/2+50; y: 10; width: 20; height: 40 }
Repeater {
dataSource: Page.height/20
- Rect { color: "#00ee00"; x: Page.width/2-5; y: index*20; width: 10; height: 10 }
+ Rectangle { color: "#00ee00"; x: Page.width/2-5; y: index*20; width: 10; height: 10 }
}
}