PathAnimation QML Type

Animates an item along a path. 更多...

import 语句: import QtQuick 2.2
Since: Qt 5.0
继承: Animation

特性

详细描述

When used in a transition, the path can be specified without start or end points, for example:

PathAnimation {
    path: Path {
        //no startX, startY
        PathCurve { x: 100; y: 100}
        PathCurve {}    //last element is empty with no end point specified
    }
}
					

In the above case, the path start will be the item's current position, and the path end will be the item's target position in the target state.

另请参阅 Qt Quick 中的动画和过渡 and PathInterpolator .

特性文档编制

anchorPoint : point

This property holds the anchor point for the item being animated.

By default, the upper-left corner of the target (its 0,0 point) will be anchored to (or follow) the path. The anchorPoint property can be used to specify a different point for anchoring. For example, specifying an anchorPoint of 5,5 for a 10x10 item means the center of the item will follow the path.

duration : int

This property holds the duration of the animation, in milliseconds.

The default value is 250.

easing group

easing.amplitude : real
easing.bezierCurve : list < real >
easing.overshoot : real
easing.period : real
easing.type : enumeration

the easing curve used for the animation.

To specify an easing curve you need to specify at least the type. For some curves you can also specify amplitude, period, overshoot or custom bezierCurve data. The default easing curve is Easing.Linear .

PropertyAnimation::easing.type documentation for information about the different types of easing curves.

endRotation : real

This property holds the ending rotation for the target.

If an orientation has been specified for the PathAnimation , and the path doesn't end with the item at the desired rotation, the endRotation property can be used to manually specify an end rotation.

This property is typically used with orientationExitDuration , as specifying an endRotation without an orientationExitDuration may cause a jump to the final rotation, rather than a smooth transition.

orientation : enumeration

This property controls the rotation of the item as it animates along the path.

If a value other than Fixed is specified, the PathAnimation will rotate the item to achieve the specified orientation as it travels along the path.


orientationEntryDuration : real

This property holds the duration (in milliseconds) of the transition in to the orientation.

If an orientation has been specified for the PathAnimation , and the starting rotation of the item does not match that given by the orientation, orientationEntryDuration can be used to smoothly transition from the item's starting rotation to the rotation given by the path orientation.

orientationExitDuration : real

This property holds the duration (in milliseconds) of the transition out of the orientation.

If an orientation and endRotation have been specified for the PathAnimation , orientationExitDuration can be used to smoothly transition from the rotation given by the path orientation to the specified endRotation .

path : 路径

This property holds the path to animate along.

For more information on defining a path see the 路径 文档编制。

target : Item

This property holds the item to animate.