aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/doc/src/concepts/statesanimations/animations.qdoc
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2021-02-16 14:02:28 +0100
committerFabian Kosmale <fabian.kosmale@qt.io>2021-02-16 14:37:35 +0100
commit510699a6f0a891951be05f18d4417bec5525969c (patch)
tree15f5121044eb63bfed53b9abe6c5bb8daed87a4e /src/quick/doc/src/concepts/statesanimations/animations.qdoc
parent7b263f7bf5f56e43aa4eb9ad41f0655e38cb6e0e (diff)
Avoid contradiction in Animation and Transition documentation
Instead of sharing the animation, create an inline component for it and instantiate it twice. Also, fix Behavior to actually apply to color. Fixes: QTBUG-40851 Change-Id: I7dce5acb121ac6d699d782d24cc77ed9f0fa94e7 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quick/doc/src/concepts/statesanimations/animations.qdoc')
-rw-r--r--src/quick/doc/src/concepts/statesanimations/animations.qdoc9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/quick/doc/src/concepts/statesanimations/animations.qdoc b/src/quick/doc/src/concepts/statesanimations/animations.qdoc
index 11d836f001..5867fe9585 100644
--- a/src/quick/doc/src/concepts/statesanimations/animations.qdoc
+++ b/src/quick/doc/src/concepts/statesanimations/animations.qdoc
@@ -282,13 +282,10 @@ animation is rather complex, you might also consider creating a custom animation
component and assigning an instance to each Behavior, for example:
\qml
-// MyNumberAnimation.qml
-NumberAnimation { id: anim; duration: 300; easing.type: Easing.InBack }
-\endqml
-
-\qml
-// main.qml
Rectangle {
+ component MyNumberAnimation : NumberAnimation {
+ duration: 300; easing.type: Easing.InBack
+ }
Behavior on x { MyNumberAnimation {} }
Behavior on y { MyNumberAnimation {} }
}