|
| QVariantAnimation (QObject *parent=nullptr) |
|
| ~QVariantAnimation () |
|
QVariant | currentValue () const |
|
int | duration () const override |
|
QEasingCurve | easingCurve () const |
|
QVariant | endValue () const |
|
QVariant | keyValueAt (double step) const |
|
QVector< QVariantAnimation::ValuePair > | keyValues () const |
|
void | setDuration (int msecs) |
|
void | setEasingCurve (const QEasingCurve &easing) |
|
void | setEndValue (const QVariant &value) |
|
void | setKeyValueAt (double step, const QVariant &value) |
|
void | setKeyValues (const QVector< QVariantAnimation::ValuePair > &keyValues) |
|
void | setStartValue (const QVariant &value) |
|
QVariant | startValue () const |
|
| QAbstractAnimation (QObject *parent=nullptr) |
|
virtual | ~QAbstractAnimation () |
|
int | currentLoop () const |
|
int | currentLoopTime () const |
|
int | currentTime () const |
|
Direction | direction () const |
|
QAnimationGroup * | group () const |
|
int | loopCount () const |
|
void | setDirection (Direction direction) |
|
void | setLoopCount (int loopCount) |
|
State | state () const |
|
int | totalDuration () const |
|
| QObject (QObject *parent=nullptr) |
|
| ~QObject () |
|
bool | blockSignals (bool block) |
|
const QList< QObject * > & | children () const |
|
bool | connect (const QObject *sender, const QString &signalMethod, const QString &location, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection) |
|
bool | connect (const QObject *sender, const QString &signalMethod, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection) |
|
bool | disconnect (const QObject *receiver, const QString &slotMethod=QString ()) const |
|
bool | disconnect (const QString &signalMethod, const QString &location, const QObject *receiver=nullptr, const QString &slotMethod=QString ()) const |
|
bool | disconnect (const QString &signalMethod=QString (), const QObject *receiver=nullptr, const QString &slotMethod=QString ()) const |
|
void | dumpObjectInfo () |
|
void | dumpObjectTree () |
|
QList< QString > | dynamicPropertyNames () const |
|
virtual bool | eventFilter (QObject *watched, QEvent *event) |
|
template<typename T > |
T | findChild (const QString &childName=QString ()) const |
|
template<class T > |
QList< T > | findChildren (const QRegularExpression ®Exp, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
|
template<class T > |
QList< T > | findChildren (const QString &childName=QString (), Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
|
bool | inherits (const QString &className) const |
|
void | installEventFilter (QObject *filterObj) |
|
bool | isWidgetType () const |
|
bool | isWindowType () const |
|
void | killTimer (int id) |
|
const QMetaObject * | metaObject () const |
|
void | moveToThread (QThread *targetThread) |
|
QString | objectName () const |
|
QObject * | parent () const |
|
template<class T = QVariant> |
T | property (const QString &name) const |
|
void | removeEventFilter (QObject *obj) |
|
void | setObjectName (const QString &name) |
|
void | setParent (QObject *parent) |
|
bool | setProperty (const QString &name, const QVariant &value) |
|
bool | signalsBlocked () const |
|
int | startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer) |
|
QThread * | thread () const |
|
|
enum | DeletionPolicy |
|
enum | Direction |
|
enum | State |
|
void | pause () |
|
void | resume () |
|
void | setCurrentTime (int msecs) |
|
void | setPaused (bool paused) |
|
void | start (QAbstractAnimation::DeletionPolicy policy=KeepWhenStopped) |
|
void | stop () |
|
void | deleteLater () |
|
static bool | connect (const QObject *sender, const QMetaMethod &signalMethod, const QObject *receiver, const QMetaMethod &slotMethod, Qt::ConnectionType type=Qt::AutoConnection) |
|
static bool | connect (const QObject *sender, const QString &signalMethod, const QObject *receiver, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection, const QString &location=QString ()) |
|
static bool | connect (const QObject *sender, const QString &signalMethod, const QString &location, const QObject *receiver, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection) |
|
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class SlotClass , class... SlotArgs, class SlotReturn > |
static bool | connect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, SlotReturn (SlotClass::*slotMethod)(SlotArgs...), Qt::ConnectionType type=Qt::AutoConnection) |
|
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class T > |
static bool | connect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, T slotLambda, Qt::ConnectionType type=Qt::AutoConnection) |
|
static bool | disconnect (const QObject *sender, const QMetaMethod &signalMethod, const QObject *receiver, const QMetaMethod &slotMethod) |
|
static bool | disconnect (const QObject *sender, const QString &signalMethod, const QObject *receiver, const QString &slotMethod) |
|
static bool | disconnect (const QObject *sender, const QString &signalMethod, const QString &location, const QObject *receiver, const QString &slotMethod) |
|
static bool | disconnect (const QObject *sender, std::nullptr_t, const QObject *receiver, std::nullptr_t) |
|
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class SlotClass , class... SlotArgs, class SlotReturn > |
static bool | disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, SlotReturn (SlotClass::*slotMethod)(SlotArgs...)) |
|
template<class Sender , class SignalClass , class... SignalArgs, class Receiver > |
static bool | disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, std::nullptr_t slotMethod=nullptr) |
|
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class T > |
static bool | disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, T slotMethod) |
|
static QMetaObject & | staticMetaObject () |
|
static QString | tr (const char *text, const char *comment=nullptr, std::optional< int > numArg=std::optional< int >()) |
|
This class is part of the Animation System. It serves as a base class for property and item animations with methods for shared functionality.
QVariantAnimation can not be used directly since it is an abstract class. The class performs interpolation over QVariants, but leaves using the interpolated values to its subclasses. Refer to the QPropertyAnimation class description for more information about animations.
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.
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. 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 properties. Note, however, that you in most cases will be better off declaring your QVariant as a property.
Not all of the QVariant types are supported. The list below shows the currently supported QVariant types in the Animation System.
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.
}
qRegisterAnimationInterpolator<QColor>(myColorInterpolator);
Another option is to reimplement interpolated(), which returns interpolation values for the value being interpolated.
- See also
- QPropertyAnimation, QAbstractAnimation, Animation Technology
QVariantAnimation::easingCurve |
|
|
This property holds 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, the animation's duration, and iterationCount, to control how the current value changes as the animation progresses.
Properties | Class Methods |
read | easingCurve |
write | setEasingCurve |