[−][src]Struct qt_core::QVariantAnimation
The QVariantAnimation class provides a base class for animations.
C++ class: QVariantAnimation
.
The QVariantAnimation class provides a 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.
The class performs interpolation over QVariants, but leaves using the interpolated values to its subclasses. Currently, Qt provides QPropertyAnimation, which animates Qt properties. See the QPropertyAnimation class description if you wish to animate such properties.
You can then set start and end values for the property by calling setStartValue() and setEndValue(), and finally call start() to start the animation. QVariantAnimation will interpolate the property of the target object and emit valueChanged(). To react to a change in the current value you have to reimplement the updateCurrentValue() virtual function or connect to said signal.
It is also possible to set values at specified steps situated between the start and end value. The interpolation will then touch these points at the specified steps. Note that the start and end values are defined as the key values at 0.0 and 1.0.
There are two ways to affect how QVariantAnimation 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 QVariantAnimation, and reimplementing the virtual interpolated() function.
Subclassing QVariantAnimation can be an alternative if you have QVariants that you do not wish to declare as Qt properties. Note, however, that you in most cases will be better off declaring your QVariant as a property.
Not all QVariant types are supported. Below is a list of currently supported QVariant types:
If you need to interpolate other variant types, including custom types, you have to implement interpolation for these yourself. To do this, you can register an interpolator function for a given type. This function takes 3 parameters: the start value, the end value, and the current progress.
Example:
QVariant myColorInterpolator(const QColor &start, const QColor &end, qreal progress) { ... return QColor(...); } ... qRegisterAnimationInterpolator<QColor>(myColorInterpolator);
Another option is to reimplement interpolated(), which returns interpolation values for the value being interpolated.
Methods
impl QVariantAnimation
[src]
pub fn value_changed(&self) -> Signal<(*const QVariant,)>
[src]
QVariantAnimation emits this signal whenever the current value changes.
Returns a built-in Qt signal QVariantAnimation::valueChanged
that can be passed to qt_core::Signal::connect
.
QVariantAnimation emits this signal whenever the current value changes.
Note: Notifier signal for property currentValue.
See also currentValue, startValue, and endValue.
pub unsafe fn current_value(&self) -> CppBox<QVariant>
[src]
This property holds the current value of the animation.
Calls C++ function: QVariant QVariantAnimation::currentValue() const
.
This property holds the current value of the animation.
This property describes the current value; an interpolated value between the start value and the end value, using the current time for progress. The value itself is obtained from interpolated(), which is called repeatedly as the animation is running.
QVariantAnimation calls the virtual updateCurrentValue() function when the current value changes. This is particularly useful for subclasses that need to track updates. For example, QPropertyAnimation uses this function to animate Qt properties.
Access functions:
QVariant | currentValue() const |
Notifier signal:
void | valueChanged(const QVariant &value) |
See also startValue and endValue.
pub unsafe fn duration(&self) -> c_int
[src]
This property holds the duration of the animation
Calls C++ function: virtual int QVariantAnimation::duration() const
.
This property holds the duration of the animation
This property describes the duration in milliseconds of the animation. The default duration is 250 milliseconds.
Access functions:
virtual int | duration() const |
void | setDuration(int msecs) |
See also QAbstractAnimation::duration().
pub unsafe fn easing_curve(&self) -> CppBox<QEasingCurve>
[src]
This property holds the easing curve of the animation
Calls C++ function: QEasingCurve QVariantAnimation::easingCurve() const
.
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. Other curves are provided, for instance, QEasingCurve::InCirc, which provides a circular entry curve. Another example is QEasingCurve::InOutElastic, which provides an elastic effect on the values of the interpolated variant.
QVariantAnimation will use the QEasingCurve::valueForProgress() to transform the "normalized progress" (currentTime / totalDuration) of the animation into the effective progress actually used by the animation. It is this effective progress that will be the progress when interpolated() is called. Also, the steps in the keyValues are referring to this effective progress.
The easing curve is used with the interpolator, the interpolated() virtual function, and the animation's duration to control how the current value changes as the animation progresses.
Access functions:
QEasingCurve | easingCurve() const |
void | setEasingCurve(const QEasingCurve &easing) |
pub unsafe fn end_value(&self) -> CppBox<QVariant>
[src]
This property holds the end value of the animation
Calls C++ function: QVariant QVariantAnimation::endValue() const
.
This property holds the end value of the animation
This property describes the end value of the animation.
Access functions:
QVariant | endValue() const |
void | setEndValue(const QVariant &value) |
See also startValue.
pub unsafe fn key_value_at(&self, step: c_double) -> CppBox<QVariant>
[src]
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.
Calls C++ function: QVariant QVariantAnimation::keyValueAt(double step) const
.
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().
pub unsafe fn key_values(&self) -> CppBox<QVectorOfQPairOfDoubleQVariant>
[src]
Returns the key frames of this animation.
Calls C++ function: QVector<QPair<double, QVariant>> QVariantAnimation::keyValues() const
.
Returns the key frames of this animation.
See also keyValueAt() and setKeyValues().
pub unsafe fn meta_object(&self) -> Ptr<QMetaObject>
[src]
Calls C++ function: virtual const QMetaObject* QVariantAnimation::metaObject() const
.
pub unsafe fn new_1a(
parent: impl CastInto<Ptr<QObject>>
) -> QBox<QVariantAnimation>
[src]
parent: impl CastInto<Ptr<QObject>>
) -> QBox<QVariantAnimation>
Construct a QVariantAnimation object. parent is passed to QAbstractAnimation's constructor.
Calls C++ function: [constructor] void QVariantAnimation::QVariantAnimation(QObject* parent = …)
.
Construct a QVariantAnimation object. parent is passed to QAbstractAnimation's constructor.
pub unsafe fn new_0a() -> QBox<QVariantAnimation>
[src]
The QVariantAnimation class provides a base class for animations.
Calls C++ function: [constructor] void QVariantAnimation::QVariantAnimation()
.
The QVariantAnimation class provides a 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.
The class performs interpolation over QVariants, but leaves using the interpolated values to its subclasses. Currently, Qt provides QPropertyAnimation, which animates Qt properties. See the QPropertyAnimation class description if you wish to animate such properties.
You can then set start and end values for the property by calling setStartValue() and setEndValue(), and finally call start() to start the animation. QVariantAnimation will interpolate the property of the target object and emit valueChanged(). To react to a change in the current value you have to reimplement the updateCurrentValue() virtual function or connect to said signal.
It is also possible to set values at specified steps situated between the start and end value. The interpolation will then touch these points at the specified steps. Note that the start and end values are defined as the key values at 0.0 and 1.0.
There are two ways to affect how QVariantAnimation 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 QVariantAnimation, and reimplementing the virtual interpolated() function.
Subclassing QVariantAnimation can be an alternative if you have QVariants that you do not wish to declare as Qt properties. Note, however, that you in most cases will be better off declaring your QVariant as a property.
Not all QVariant types are supported. Below is a list of currently supported QVariant types:
If you need to interpolate other variant types, including custom types, you have to implement interpolation for these yourself. To do this, you can register an interpolator function for a given type. This function takes 3 parameters: the start value, the end value, and the current progress.
Example:
QVariant myColorInterpolator(const QColor &start, const QColor &end, qreal progress) { ... return QColor(...); } ... qRegisterAnimationInterpolator<QColor>(myColorInterpolator);
Another option is to reimplement interpolated(), which returns interpolation values for the value being interpolated.
pub unsafe fn qt_metacall(
&self,
arg1: Call,
arg2: c_int,
arg3: *mut *mut c_void
) -> c_int
[src]
&self,
arg1: Call,
arg2: c_int,
arg3: *mut *mut c_void
) -> c_int
Calls C++ function: virtual int QVariantAnimation::qt_metacall(QMetaObject::Call arg1, int arg2, void** arg3)
.
pub unsafe fn qt_metacast(&self, arg1: *const c_char) -> *mut c_void
[src]
Calls C++ function: virtual void* QVariantAnimation::qt_metacast(const char* arg1)
.
pub unsafe fn set_duration(&self, msecs: c_int)
[src]
This property holds the duration of the animation
Calls C++ function: void QVariantAnimation::setDuration(int msecs)
.
This property holds the duration of the animation
This property describes the duration in milliseconds of the animation. The default duration is 250 milliseconds.
Access functions:
virtual int | duration() const |
void | setDuration(int msecs) |
See also QAbstractAnimation::duration().
pub unsafe fn set_easing_curve(&self, easing: impl CastInto<Ref<QEasingCurve>>)
[src]
This property holds the easing curve of the animation
Calls C++ function: void QVariantAnimation::setEasingCurve(const QEasingCurve& easing)
.
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. Other curves are provided, for instance, QEasingCurve::InCirc, which provides a circular entry curve. Another example is QEasingCurve::InOutElastic, which provides an elastic effect on the values of the interpolated variant.
QVariantAnimation will use the QEasingCurve::valueForProgress() to transform the "normalized progress" (currentTime / totalDuration) of the animation into the effective progress actually used by the animation. It is this effective progress that will be the progress when interpolated() is called. Also, the steps in the keyValues are referring to this effective progress.
The easing curve is used with the interpolator, the interpolated() virtual function, and the animation's duration to control how the current value changes as the animation progresses.
Access functions:
QEasingCurve | easingCurve() const |
void | setEasingCurve(const QEasingCurve &easing) |
pub unsafe fn set_end_value(&self, value: impl CastInto<Ref<QVariant>>)
[src]
This property holds the end value of the animation
Calls C++ function: void QVariantAnimation::setEndValue(const QVariant& value)
.
This property holds the end value of the animation
This property describes the end value of the animation.
Access functions:
QVariant | endValue() const |
void | setEndValue(const QVariant &value) |
See also startValue.
pub unsafe fn set_key_value_at(
&self,
step: c_double,
value: impl CastInto<Ref<QVariant>>
)
[src]
&self,
step: c_double,
value: impl CastInto<Ref<QVariant>>
)
Creates a key frame at the given step with the given value. The given step must be in the range 0 to 1.
Calls C++ function: void QVariantAnimation::setKeyValueAt(double step, const QVariant& value)
.
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().
pub unsafe fn set_key_values(
&self,
values: impl CastInto<Ref<QVectorOfQPairOfDoubleQVariant>>
)
[src]
&self,
values: impl CastInto<Ref<QVectorOfQPairOfDoubleQVariant>>
)
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.
Calls C++ function: void QVariantAnimation::setKeyValues(const QVector<QPair<double, QVariant>>& values)
.
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().
pub unsafe fn set_start_value(&self, value: impl CastInto<Ref<QVariant>>)
[src]
This property holds the optional start value of the animation
Calls C++ function: void QVariantAnimation::setStartValue(const QVariant& value)
.
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:
QVariant | startValue() const |
void | setStartValue(const QVariant &value) |
See also endValue.
pub unsafe fn start_value(&self) -> CppBox<QVariant>
[src]
This property holds the optional start value of the animation
Calls C++ function: QVariant QVariantAnimation::startValue() const
.
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:
QVariant | startValue() const |
void | setStartValue(const QVariant &value) |
See also endValue.
pub unsafe fn static_meta_object() -> Ref<QMetaObject>
[src]
Returns a reference to the staticMetaObject
field.
pub unsafe fn tr(
s: *const c_char,
c: *const c_char,
n: c_int
) -> CppBox<QString>
[src]
s: *const c_char,
c: *const c_char,
n: c_int
) -> CppBox<QString>
Calls C++ function: static QString QVariantAnimation::tr(const char* s, const char* c, int n)
.
pub unsafe fn tr_utf8(
s: *const c_char,
c: *const c_char,
n: c_int
) -> CppBox<QString>
[src]
s: *const c_char,
c: *const c_char,
n: c_int
) -> CppBox<QString>
Calls C++ function: static QString QVariantAnimation::trUtf8(const char* s, const char* c, int n)
.
Methods from Deref<Target = QAbstractAnimation>
pub fn finished(&self) -> Signal<()>
[src]
QAbstractAnimation emits this signal after the animation has stopped and has reached the end.
Returns a built-in Qt signal QAbstractAnimation::finished
that can be passed to qt_core::Signal::connect
.
QAbstractAnimation emits this signal after the animation has stopped and has reached the end.
This signal is emitted after stateChanged().
See also stateChanged().
pub fn state_changed(&self) -> Signal<(State, State)>
[src]
QAbstractAnimation emits this signal whenever the state of the animation has changed from oldState to newState. This signal is emitted after the virtual updateState() function is called.
Returns a built-in Qt signal QAbstractAnimation::stateChanged
that can be passed to qt_core::Signal::connect
.
QAbstractAnimation emits this signal whenever the state of the animation has changed from oldState to newState. This signal is emitted after the virtual updateState() function is called.
Note: Notifier signal for property state.
See also updateState().
pub fn current_loop_changed(&self) -> Signal<(c_int,)>
[src]
QAbstractAnimation emits this signal whenever the current loop changes. currentLoop is the current loop.
Returns a built-in Qt signal QAbstractAnimation::currentLoopChanged
that can be passed to qt_core::Signal::connect
.
QAbstractAnimation emits this signal whenever the current loop changes. currentLoop is the current loop.
Note: Notifier signal for property currentLoop.
See also currentLoop() and loopCount().
pub fn direction_changed(&self) -> Signal<(Direction,)>
[src]
QAbstractAnimation emits this signal whenever the direction has been changed. newDirection is the new direction.
Returns a built-in Qt signal QAbstractAnimation::directionChanged
that can be passed to qt_core::Signal::connect
.
QAbstractAnimation emits this signal whenever the direction has been changed. newDirection is the new direction.
Note: Notifier signal for property direction.
See also direction.
pub fn slot_start(&self) -> Receiver<(DeletionPolicy,)>
[src]
Starts the animation. The policy argument says whether or not the animation should be deleted when it's done. When the animation starts, the stateChanged() signal is emitted, and state() returns Running. When control reaches the event loop, the animation will run by itself, periodically calling updateCurrentTime() as the animation progresses.
Returns a built-in Qt slot QAbstractAnimation::start
that can be passed to qt_core::Signal::connect
.
Starts the animation. The policy argument says whether or not the animation should be deleted when it's done. When the animation starts, the stateChanged() signal is emitted, and state() returns Running. When control reaches the event loop, the animation will run by itself, periodically calling updateCurrentTime() as the animation progresses.
If the animation is currently stopped or has already reached the end, calling start() will rewind the animation and start again from the beginning. When the animation reaches the end, the animation will either stop, or if the loop level is more than 1, it will rewind and continue from the beginning.
If the animation is already running, this function does nothing.
pub fn slot_pause(&self) -> Receiver<()>
[src]
Pauses the animation. When the animation is paused, state() returns Paused. The value of currentTime will remain unchanged until resume() or start() is called. If you want to continue from the current time, call resume().
Returns a built-in Qt slot QAbstractAnimation::pause
that can be passed to qt_core::Signal::connect
.
pub fn slot_resume(&self) -> Receiver<()>
[src]
Resumes the animation after it was paused. When the animation is resumed, it emits the resumed() and stateChanged() signals. The currenttime is not changed.
Returns a built-in Qt slot QAbstractAnimation::resume
that can be passed to qt_core::Signal::connect
.
Resumes the animation after it was paused. When the animation is resumed, it emits the resumed() and stateChanged() signals. The currenttime is not changed.
pub fn slot_set_paused(&self) -> Receiver<(bool,)>
[src]
If paused is true, the animation is paused. If paused is false, the animation is resumed.
Returns a built-in Qt slot QAbstractAnimation::setPaused
that can be passed to qt_core::Signal::connect
.
pub fn slot_stop(&self) -> Receiver<()>
[src]
Stops the animation. When the animation is stopped, it emits the stateChanged() signal, and state() returns Stopped. The current time is not changed.
Returns a built-in Qt slot QAbstractAnimation::stop
that can be passed to qt_core::Signal::connect
.
Stops the animation. When the animation is stopped, it emits the stateChanged() signal, and state() returns Stopped. The current time is not changed.
If the animation stops by itself after reaching the end (i.e., currentLoopTime() == duration() and currentLoop() > loopCount() - 1), the finished() signal is emitted.
pub fn slot_set_current_time(&self) -> Receiver<(c_int,)>
[src]
This property holds the current time and progress of the animation
Returns a built-in Qt slot QAbstractAnimation::setCurrentTime
that can be passed to qt_core::Signal::connect
.
This property holds the current time and progress of the animation
This property describes the animation's current time. You can change the current time by calling setCurrentTime, or you can call start() and let the animation run, setting the current time automatically as the animation progresses.
The animation's current time starts at 0, and ends at totalDuration().
Access functions:
int | currentTime() const |
void | setCurrentTime(int msecs) |
See also loopCount and currentLoopTime().
pub unsafe fn current_loop(&self) -> c_int
[src]
This property holds the current loop of the animation
Calls C++ function: int QAbstractAnimation::currentLoop() const
.
This property holds the current loop of the animation
This property describes the current loop of the animation. By default, the animation's loop count is 1, and so the current loop will always be 0. If the loop count is 2 and the animation runs past its duration, it will automatically rewind and restart at current time 0, and current loop 1, and so on.
When the current loop changes, QAbstractAnimation emits the currentLoopChanged() signal.
Access functions:
int | currentLoop() const |
Notifier signal:
void | currentLoopChanged(int currentLoop) |
pub unsafe fn current_loop_time(&self) -> c_int
[src]
Returns the current time inside the current loop. It can go from 0 to duration().
Calls C++ function: int QAbstractAnimation::currentLoopTime() const
.
Returns the current time inside the current loop. It can go from 0 to duration().
See also duration() and currentTime.
pub unsafe fn current_time(&self) -> c_int
[src]
This property holds the current time and progress of the animation
Calls C++ function: int QAbstractAnimation::currentTime() const
.
This property holds the current time and progress of the animation
This property describes the animation's current time. You can change the current time by calling setCurrentTime, or you can call start() and let the animation run, setting the current time automatically as the animation progresses.
The animation's current time starts at 0, and ends at totalDuration().
Access functions:
int | currentTime() const |
void | setCurrentTime(int msecs) |
See also loopCount and currentLoopTime().
pub unsafe fn direction(&self) -> Direction
[src]
This property holds the direction of the animation when it is in Running state.
Calls C++ function: QAbstractAnimation::Direction QAbstractAnimation::direction() const
.
This property holds the direction of the animation when it is in Running state.
This direction indicates whether the time moves from 0 towards the animation duration, or from the value of the duration and towards 0 after start() has been called.
By default, this property is set to Forward.
Access functions:
Direction | direction() const |
void | setDirection(Direction direction) |
Notifier signal:
void | directionChanged(QAbstractAnimation::Direction newDirection) |
pub unsafe fn duration(&self) -> c_int
[src]
This property holds the duration of the animation.
Calls C++ function: pure virtual int QAbstractAnimation::duration() const
.
pub unsafe fn group(&self) -> QPtr<QAnimationGroup>
[src]
If this animation is part of a QAnimationGroup, this function returns a pointer to the group; otherwise, it returns 0.
Calls C++ function: QAnimationGroup* QAbstractAnimation::group() const
.
If this animation is part of a QAnimationGroup, this function returns a pointer to the group; otherwise, it returns 0.
See also QAnimationGroup::addAnimation().
pub unsafe fn loop_count(&self) -> c_int
[src]
This property holds the loop count of the animation
Calls C++ function: int QAbstractAnimation::loopCount() const
.
This property holds the loop count of the animation
This property describes the loop count of the animation as an integer. By default this value is 1, indicating that the animation should run once only, and then stop. By changing it you can let the animation loop several times. With a value of 0, the animation will not run at all, and with a value of -1, the animation will loop forever until stopped. It is not supported to have loop on an animation that has an undefined duration. It will only run once.
Access functions:
int | loopCount() const |
void | setLoopCount(int loopCount) |
pub unsafe fn meta_object(&self) -> Ptr<QMetaObject>
[src]
Calls C++ function: virtual const QMetaObject* QAbstractAnimation::metaObject() const
.
pub unsafe fn pause(&self)
[src]
Pauses the animation. When the animation is paused, state() returns Paused. The value of currentTime will remain unchanged until resume() or start() is called. If you want to continue from the current time, call resume().
Calls C++ function: [slot] void QAbstractAnimation::pause()
.
pub unsafe fn qt_metacall(
&self,
arg1: Call,
arg2: c_int,
arg3: *mut *mut c_void
) -> c_int
[src]
&self,
arg1: Call,
arg2: c_int,
arg3: *mut *mut c_void
) -> c_int
Calls C++ function: virtual int QAbstractAnimation::qt_metacall(QMetaObject::Call arg1, int arg2, void** arg3)
.
pub unsafe fn qt_metacast(&self, arg1: *const c_char) -> *mut c_void
[src]
Calls C++ function: virtual void* QAbstractAnimation::qt_metacast(const char* arg1)
.
pub unsafe fn resume(&self)
[src]
Resumes the animation after it was paused. When the animation is resumed, it emits the resumed() and stateChanged() signals. The currenttime is not changed.
Calls C++ function: [slot] void QAbstractAnimation::resume()
.
Resumes the animation after it was paused. When the animation is resumed, it emits the resumed() and stateChanged() signals. The currenttime is not changed.
pub unsafe fn set_current_time(&self, msecs: c_int)
[src]
This property holds the current time and progress of the animation
Calls C++ function: [slot] void QAbstractAnimation::setCurrentTime(int msecs)
.
This property holds the current time and progress of the animation
This property describes the animation's current time. You can change the current time by calling setCurrentTime, or you can call start() and let the animation run, setting the current time automatically as the animation progresses.
The animation's current time starts at 0, and ends at totalDuration().
Access functions:
int | currentTime() const |
void | setCurrentTime(int msecs) |
See also loopCount and currentLoopTime().
pub unsafe fn set_direction(&self, direction: Direction)
[src]
This property holds the direction of the animation when it is in Running state.
Calls C++ function: void QAbstractAnimation::setDirection(QAbstractAnimation::Direction direction)
.
This property holds the direction of the animation when it is in Running state.
This direction indicates whether the time moves from 0 towards the animation duration, or from the value of the duration and towards 0 after start() has been called.
By default, this property is set to Forward.
Access functions:
Direction | direction() const |
void | setDirection(Direction direction) |
Notifier signal:
void | directionChanged(QAbstractAnimation::Direction newDirection) |
pub unsafe fn set_loop_count(&self, loop_count: c_int)
[src]
This property holds the loop count of the animation
Calls C++ function: void QAbstractAnimation::setLoopCount(int loopCount)
.
This property holds the loop count of the animation
This property describes the loop count of the animation as an integer. By default this value is 1, indicating that the animation should run once only, and then stop. By changing it you can let the animation loop several times. With a value of 0, the animation will not run at all, and with a value of -1, the animation will loop forever until stopped. It is not supported to have loop on an animation that has an undefined duration. It will only run once.
Access functions:
int | loopCount() const |
void | setLoopCount(int loopCount) |
pub unsafe fn set_paused(&self, arg1: bool)
[src]
If paused is true, the animation is paused. If paused is false, the animation is resumed.
Calls C++ function: [slot] void QAbstractAnimation::setPaused(bool arg1)
.
pub unsafe fn start_1a(&self, policy: DeletionPolicy)
[src]
Starts the animation. The policy argument says whether or not the animation should be deleted when it's done. When the animation starts, the stateChanged() signal is emitted, and state() returns Running. When control reaches the event loop, the animation will run by itself, periodically calling updateCurrentTime() as the animation progresses.
Calls C++ function: [slot] void QAbstractAnimation::start(QAbstractAnimation::DeletionPolicy policy = …)
.
Starts the animation. The policy argument says whether or not the animation should be deleted when it's done. When the animation starts, the stateChanged() signal is emitted, and state() returns Running. When control reaches the event loop, the animation will run by itself, periodically calling updateCurrentTime() as the animation progresses.
If the animation is currently stopped or has already reached the end, calling start() will rewind the animation and start again from the beginning. When the animation reaches the end, the animation will either stop, or if the loop level is more than 1, it will rewind and continue from the beginning.
If the animation is already running, this function does nothing.
pub unsafe fn start_0a(&self)
[src]
Starts the animation. The policy argument says whether or not the animation should be deleted when it's done. When the animation starts, the stateChanged() signal is emitted, and state() returns Running. When control reaches the event loop, the animation will run by itself, periodically calling updateCurrentTime() as the animation progresses.
Calls C++ function: [slot] void QAbstractAnimation::start()
.
Starts the animation. The policy argument says whether or not the animation should be deleted when it's done. When the animation starts, the stateChanged() signal is emitted, and state() returns Running. When control reaches the event loop, the animation will run by itself, periodically calling updateCurrentTime() as the animation progresses.
If the animation is currently stopped or has already reached the end, calling start() will rewind the animation and start again from the beginning. When the animation reaches the end, the animation will either stop, or if the loop level is more than 1, it will rewind and continue from the beginning.
If the animation is already running, this function does nothing.
pub unsafe fn state(&self) -> State
[src]
state of the animation.
Calls C++ function: QAbstractAnimation::State QAbstractAnimation::state() const
.
state of the animation.
This property describes the current state of the animation. When the animation state changes, QAbstractAnimation emits the stateChanged() signal.
Access functions:
State | state() const |
Notifier signal:
void | stateChanged(QAbstractAnimation::State newState, QAbstractAnimation::State oldState) |
pub unsafe fn stop(&self)
[src]
Stops the animation. When the animation is stopped, it emits the stateChanged() signal, and state() returns Stopped. The current time is not changed.
Calls C++ function: [slot] void QAbstractAnimation::stop()
.
Stops the animation. When the animation is stopped, it emits the stateChanged() signal, and state() returns Stopped. The current time is not changed.
If the animation stops by itself after reaching the end (i.e., currentLoopTime() == duration() and currentLoop() > loopCount() - 1), the finished() signal is emitted.
pub unsafe fn total_duration(&self) -> c_int
[src]
Returns the total and effective duration of the animation, including the loop count.
Calls C++ function: int QAbstractAnimation::totalDuration() const
.
Returns the total and effective duration of the animation, including the loop count.
See also duration() and currentTime.
Trait Implementations
impl CppDeletable for QVariantAnimation
[src]
unsafe fn delete(&self)
[src]
Destroys the animation.
Calls C++ function: virtual [destructor] void QVariantAnimation::~QVariantAnimation()
.
Destroys the animation.
impl Deref for QVariantAnimation
[src]
type Target = QAbstractAnimation
The resulting type after dereferencing.
fn deref(&self) -> &QAbstractAnimation
[src]
Calls C++ function: QAbstractAnimation* static_cast<QAbstractAnimation*>(QVariantAnimation* ptr)
.
impl DynamicCast<QPropertyAnimation> for QVariantAnimation
[src]
unsafe fn dynamic_cast(ptr: Ptr<QVariantAnimation>) -> Ptr<QPropertyAnimation>
[src]
Calls C++ function: QPropertyAnimation* dynamic_cast<QPropertyAnimation*>(QVariantAnimation* ptr)
.
impl DynamicCast<QVariantAnimation> for QAbstractAnimation
[src]
unsafe fn dynamic_cast(ptr: Ptr<QAbstractAnimation>) -> Ptr<QVariantAnimation>
[src]
Calls C++ function: QVariantAnimation* dynamic_cast<QVariantAnimation*>(QAbstractAnimation* ptr)
.
impl DynamicCast<QVariantAnimation> for QObject
[src]
unsafe fn dynamic_cast(ptr: Ptr<QObject>) -> Ptr<QVariantAnimation>
[src]
Calls C++ function: QVariantAnimation* dynamic_cast<QVariantAnimation*>(QObject* ptr)
.
impl StaticDowncast<QPropertyAnimation> for QVariantAnimation
[src]
unsafe fn static_downcast(
ptr: Ptr<QVariantAnimation>
) -> Ptr<QPropertyAnimation>
[src]
ptr: Ptr<QVariantAnimation>
) -> Ptr<QPropertyAnimation>
Calls C++ function: QPropertyAnimation* static_cast<QPropertyAnimation*>(QVariantAnimation* ptr)
.
impl StaticDowncast<QVariantAnimation> for QAbstractAnimation
[src]
unsafe fn static_downcast(
ptr: Ptr<QAbstractAnimation>
) -> Ptr<QVariantAnimation>
[src]
ptr: Ptr<QAbstractAnimation>
) -> Ptr<QVariantAnimation>
Calls C++ function: QVariantAnimation* static_cast<QVariantAnimation*>(QAbstractAnimation* ptr)
.
impl StaticDowncast<QVariantAnimation> for QObject
[src]
unsafe fn static_downcast(ptr: Ptr<QObject>) -> Ptr<QVariantAnimation>
[src]
Calls C++ function: QVariantAnimation* static_cast<QVariantAnimation*>(QObject* ptr)
.
impl StaticUpcast<QAbstractAnimation> for QVariantAnimation
[src]
unsafe fn static_upcast(ptr: Ptr<QVariantAnimation>) -> Ptr<QAbstractAnimation>
[src]
Calls C++ function: QAbstractAnimation* static_cast<QAbstractAnimation*>(QVariantAnimation* ptr)
.
impl StaticUpcast<QObject> for QVariantAnimation
[src]
unsafe fn static_upcast(ptr: Ptr<QVariantAnimation>) -> Ptr<QObject>
[src]
Calls C++ function: QObject* static_cast<QObject*>(QVariantAnimation* ptr)
.
impl StaticUpcast<QVariantAnimation> for QPropertyAnimation
[src]
unsafe fn static_upcast(ptr: Ptr<QPropertyAnimation>) -> Ptr<QVariantAnimation>
[src]
Calls C++ function: QVariantAnimation* static_cast<QVariantAnimation*>(QPropertyAnimation* ptr)
.
Auto Trait Implementations
impl RefUnwindSafe for QVariantAnimation
impl Send for QVariantAnimation
impl Sync for QVariantAnimation
impl Unpin for QVariantAnimation
impl UnwindSafe for QVariantAnimation
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> CastInto<U> for T where
U: CastFrom<T>,
[src]
U: CastFrom<T>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> StaticUpcast<T> for T
[src]
unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,