QML AnchorAnimation ElementThe AnchorAnimation element animates changes in anchor values. More... Inherits Animation This element was introduced in Qt 4.7. Properties
Detailed DescriptionAnchorAnimation is used to animate an anchor change. In the following snippet we animate the addition of a right anchor to a Rectangle: import QtQuick 1.0 Item { id: container width: 200; height: 200 Rectangle { id: myRect width: 100; height: 100 color: "red" } states: State { name: "reanchored" AnchorChanges { target: myRect; anchors.right: container.right } } transitions: Transition { // smoothly reanchor myRect and move into new position AnchorAnimation { duration: 1000 } } Component.onCompleted: container.state = "reanchored" } For convenience, when an AnchorAnimation is used in a Transition, it will animate any AnchorChanges that have occurred during the state change. This can be overridden by setting a specific target item using the target property. Like any other animation element, an AnchorAnimation can be applied in a number of ways, including transitions, behaviors and property value sources. The QML Animation and Transitions documentation shows a variety of methods for creating animations. See also QML Animation and Transitions and AnchorChanges. Property DocumentationThis property holds the duration of the animation, in milliseconds. The default value is 250. To specify an easing curve you need to specify at least the type. For some curves you can also specify amplitude, period and/or overshoot. The default easing curve is Linear. AnchorAnimation { easing.type: Easing.InOutQuad } See the PropertyAnimation::easing.type documentation for information about the different types of easing curves. The items to reanchor. If no targets are specified all AnchorChanges will be animated by the AnchorAnimation.
© 2008-2011 Nokia Corporation and/or its subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation in Finland and/or other countries worldwide. All other trademarks are property of their respective owners. Privacy Policy Licensees holding valid Qt Commercial licenses may use this document in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and Nokia. Alternatively, this document may be used under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. |