summaryrefslogtreecommitdiffstats
path: root/examples/declarative/follow
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2009-07-29 01:28:49 (GMT)
committerMartin Jones <martin.jones@nokia.com>2009-07-29 01:28:49 (GMT)
commitb155698f5408b9753a6b28e6c2833d83aff2ceb4 (patch)
tree680687e463aed5a8e6670b40b04785160bbbb597 /examples/declarative/follow
parented934bd87a2922e7a044d59e45330cd078d06d8c (diff)
downloadQt-b155698f5408b9753a6b28e6c2833d83aff2ceb4.zip
Qt-b155698f5408b9753a6b28e6c2833d83aff2ceb4.tar.gz
Qt-b155698f5408b9753a6b28e6c2833d83aff2ceb4.tar.bz2
Add mass property to follow.
Diffstat (limited to 'examples/declarative/follow')
-rw-r--r--examples/declarative/follow/follow.qml12
1 files changed, 10 insertions, 2 deletions
diff --git a/examples/declarative/follow/follow.qml b/examples/declarative/follow/follow.qml
index b906c12..59561b3 100644
--- a/examples/declarative/follow/follow.qml
+++ b/examples/declarative/follow/follow.qml
@@ -25,6 +25,7 @@ Rect {
Rect {
color: "#ff0000"
x: Rect.width; width: Rect.width; height: 20
+ y: 200
y: Follow { source: Rect.y; velocity: 200 }
}
Text { x: Rect.width; y: 220; text: "Velocity" }
@@ -32,8 +33,15 @@ Rect {
// Spring
Rect {
color: "#ff0000"
- x: Rect.width * 2; width: Rect.width; height: 20
- y: Follow { source: Rect.y; spring: 1.2; damping: 0.1 }
+ x: Rect.width * 2; width: Rect.width/2; height: 20
+ y: 200
+ y: Follow { source: Rect.y; spring: 1.0; damping: 0.2 }
+ }
+ Rect {
+ color: "#880000"
+ x: Rect.width * 2.5; width: Rect.width/2; height: 20
+ y: 200
+ y: Follow { source: Rect.y; spring: 1.0; damping: 0.2; mass: 3.0 } // "heavier" object
}
Text { x: Rect.width * 2; y: 220; text: "Spring" }