diff options
Diffstat (limited to 'src/quick/doc/snippets/qml/animation.qml')
-rw-r--r-- | src/quick/doc/snippets/qml/animation.qml | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/quick/doc/snippets/qml/animation.qml b/src/quick/doc/snippets/qml/animation.qml index 5b20f84629..4de88263b9 100644 --- a/src/quick/doc/snippets/qml/animation.qml +++ b/src/quick/doc/snippets/qml/animation.qml @@ -170,20 +170,21 @@ Rectangle { id: ball color: "salmon" + component BounceAnimation : NumberAnimation { + easing { + type: Easing.OutElastic + amplitude: 1.0 + period: 0.5 + } + } + Behavior on x { - NumberAnimation { - id: bouncebehavior - easing { - type: Easing.OutElastic - amplitude: 1.0 - period: 0.5 - } - } + BounceAnimation {} } Behavior on y { - animation: bouncebehavior + BounceAnimation {} } - Behavior { + Behavior on color { ColorAnimation { target: ball; duration: 100 } } } |