summaryrefslogtreecommitdiffstats
path: root/examples/declarative/follow/follow.qml
diff options
context:
space:
mode:
Diffstat (limited to 'examples/declarative/follow/follow.qml')
-rw-r--r--examples/declarative/follow/follow.qml17
1 files changed, 15 insertions, 2 deletions
diff --git a/examples/declarative/follow/follow.qml b/examples/declarative/follow/follow.qml
index 21a0309..37a953c 100644
--- a/examples/declarative/follow/follow.qml
+++ b/examples/declarative/follow/follow.qml
@@ -40,11 +40,24 @@ Rect {
id: Mouse
anchors.fill: parent
Rect {
+ id: "Ball"
width: 20; height: 20
radius: 10
color: "#0000ff"
- x: Follow { source: Mouse.mouseX-10; spring: 1.0; damping: 0.05 }
- y: Follow { source: Mouse.mouseY-10; spring: 1.0; damping: 0.05 }
+ x: Follow { id: "F1"; source: Mouse.mouseX-10; spring: 1.0; damping: 0.05; epsilon: 0.25 }
+ y: Follow { id: "F2"; source: Mouse.mouseY-10; spring: 1.0; damping: 0.05; epsilon: 0.25 }
+ states: [
+ State {
+ name: "following"
+ when: !F1.inSync || !F2.inSync
+ SetProperties { target: Ball; color: "#ff0000" }
+ }
+ ]
+ transitions: [
+ Transition {
+ ColorAnimation { duration: 200 }
+ }
+ ]
}
}
}