aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/animation/behaviors
diff options
context:
space:
mode:
Diffstat (limited to 'examples/quick/animation/behaviors')
-rw-r--r--examples/quick/animation/behaviors/behavior-example.qml2
-rw-r--r--examples/quick/animation/behaviors/tvtennis.qml2
-rw-r--r--examples/quick/animation/behaviors/wigglytext.qml4
3 files changed, 8 insertions, 0 deletions
diff --git a/examples/quick/animation/behaviors/behavior-example.qml b/examples/quick/animation/behaviors/behavior-example.qml
index a88d7c8c7b..e77c3537a0 100644
--- a/examples/quick/animation/behaviors/behavior-example.qml
+++ b/examples/quick/animation/behaviors/behavior-example.qml
@@ -92,10 +92,12 @@ Rectangle {
NumberAnimation { easing.type: Easing.OutElastic; easing.amplitude: 3.0; easing.period: 2.0; duration: 300 }
}
+ //! [0]
// Set an 'elastic' behavior on the focusRect's y property.
Behavior on y {
NumberAnimation { easing.type: Easing.OutElastic; easing.amplitude: 3.0; easing.period: 2.0; duration: 300 }
}
+ //! [0]
Text {
id: focusText
diff --git a/examples/quick/animation/behaviors/tvtennis.qml b/examples/quick/animation/behaviors/tvtennis.qml
index 108f19a11d..667b33fb81 100644
--- a/examples/quick/animation/behaviors/tvtennis.qml
+++ b/examples/quick/animation/behaviors/tvtennis.qml
@@ -86,8 +86,10 @@ Rectangle {
id: leftBat
color: "Lime"
x: 2; width: 20; height: 90
+ // ![0]
y: ball.direction == 'left' ? ball.y - 45 : page.height/2 -45;
Behavior on y { SpringAnimation{ velocity: 300 } }
+ // ![0]
}
Rectangle {
id: rightBat
diff --git a/examples/quick/animation/behaviors/wigglytext.qml b/examples/quick/animation/behaviors/wigglytext.qml
index 4bb94da100..67e6da3fbb 100644
--- a/examples/quick/animation/behaviors/wigglytext.qml
+++ b/examples/quick/animation/behaviors/wigglytext.qml
@@ -86,8 +86,10 @@ Rectangle {
id: letter
property variant follow
+//! [0]
x: follow ? follow.x + follow.width : container.width / 6
y: follow ? follow.y : container.height / 2
+//! [0]
font.pixelSize: 40; font.bold: true
color: "#999999"; styleColor: "#222222"; style: Text.Raised
@@ -99,8 +101,10 @@ Rectangle {
onReleased: letter.color = "#999999"
}
+//! [1]
Behavior on x { enabled: container.animated; SpringAnimation { spring: 3; damping: 0.3; mass: 1.0 } }
Behavior on y { enabled: container.animated; SpringAnimation { spring: 3; damping: 0.3; mass: 1.0 } }
+//! [1]
}
}