Home |
The QtVariantAnimation class provides an abstract base class for animations. More...
#include <QtVariantAnimation>
This class is under development and is subject to change.
Inherits QtAbstractAnimation.
Inherited by QtPropertyAnimation.
|
|
The QtVariantAnimation class provides an abstract base class for animations.
This class is part of {The Animation Framework}. It serves as a base class for property and item animations, with functions for shared functionality.
If you want to create an animation, you should look at QtPropertyAnimation instead.
You can then set start and end values for the property by calling setStartValue() and setEndValue(), and finally call start() to start the animation. When control goes back to the event loop, QtVariantAnimation will interpolate the property of the target object and emit the valueChanged signal. To react to a change in the current value you have to reimplement the updateCurrentValue virtual method.
There are two ways to affect how QtVariantAnimation interpolates the values. You can set an easing curve by calling setEasingCurve(), and configure the duration by calling setDuration(). You can change how the QVariants are interpolated by creating a subclass of QtVariantAnimation, and reimplementing the virtual interpolated() function.
See also QtPropertyAnimation and The Animation Framework.
This is a typedef for QPair<qreal, QVariant>.
This is a typedef for QVector<KeyValue>
This property holds the current value of the animation.
This property describes the current value; an interpolation between the start value and the end value, using the current time for progress.
QtVariantAnimation calls the virtual updateCurrentValue() function when the current value changes. This is particularily useful for subclasses that need to track updates.
Access functions:
See also startValue and endValue.
This property holds the duration of the animation.
This property describes the duration of the animation. The default duration is 250 milliseconds.
Access functions:
See also QtAbstractAnimation::duration().
This property holds the easing curve of the animation.
This property defines the easing curve of the animation. By default, a linear easing curve is used, resulting in linear interpolation of the end property. For many animations, it's useful to try different easing curves, including QtEasingCurve::InCirc, which provides a circular entry curve, and QtEasingCurve::InOutElastic, which provides an elastic effect on the values of the interpolated property.
The easing curve is used with the interpolator, the interpolated() virtual function, the animation's duration, and loopCount, to control how the current value changes as the animation progresses.
Access functions:
This property holds the end value of the animation.
This property describes the end value of the animation.
Access functions:
See also startValue.
This property holds the optional start value of the animation.
This property describes the optional start value of the animation. If omitted, or if a null QVariant is assigned as the start value, the animation will use the current position of the end when the animation is started.
Access functions:
See also endValue.
Construct a QtVariantAnimation object. parent is passed to QtAbstractAnimation's constructor.
Destroys the animation.
This virtual function returns the linear interpolation between variants from and to, at progress, usually a value between 0 and 1. You can reimplement this function in a subclass of QtVariantAnimation to provide your own interpolation algorithm. Note that in order for the interpolation to work with a QtEasingCurve that return a value smaller than 0 or larger than 1 (such as QtEasingCurve::InBack) you should make sure that it can extrapolate. If the semantic of the datatype does not allow extrapolation this function should handle that gracefully.
See also QtEasingCurve.
Returns the key frame value for the given step. The given step must be in the range 0 to 1. If there is no KeyValue for step, it returns an invalid QVariant.
See also keyValues() and setKeyValueAt().
Returns the key frames of this animation.
See also keyValueAt() and setKeyValues().
Creates a key frame at the given step with the given value. The given step must be in the range 0 to 1.
See also setKeyValues() and keyValueAt().
Replaces the current set of key frames with the given keyValues. the step of the key frames must be in the range 0 to 1.
See also keyValues() and keyValueAt().
This pure virtual function is called when the animated value is changed. value is the new value.
QtVariantAnimation emits this signal whenever the current value changes.
See also currentValue, startValue, and endValue.
Registers a custom interpolator func for the template type T. The interpolator has to be registered before the animation is constructed. To unregister (and use the default interpolator) set func to 0.
Note: This function is thread-safe.
Copyright © 2009 Nokia | Trademarks | Qt Solutions |