Document directory
- Qpropertyanimation
- Qanimationgroup
- BTW
Reference the official image:
Qpropertyanimation
The bottom layer of the qpropertyanimation animation framework is directly used. It is translated as an attribute animation. As the name suggests, it is used to implement the animation of the specified object attribute.
Qpropertyanimation requires that the qobject to be operated must have a property setter and a getter. The animation effect is implemented by dynamically modifying the property member variables of the target object, and then re-painting the object. To dynamically modify the property of an object, call getter to obtain the original property value and setter to set the new property value.
When constructing qpropertyanimation, the object pointer and the attribute string are passed in. Dynamically call the getter and setter of this attribute through the attribute string Unclear technical implementation details, A bit similar to the reflection function.
The startproperty and endproperty of the qpropertyanimation object are interpolated to calculate a set of attribute values. The Group length is the number of animated frames, and each frame corresponds to a property value. Property is a general term, similar to the template's typename. Attributes can be converted into the object location, size, rotation angle, and so on.
The qeasingcurve class is used when the qpropertyanimation interpolation attribute value is used. This class controls the animation interpolation to output a set of standard values. The Group length is the number of frames, and the standard value is between 0 and 1. Qeasingcurve supports 43 animation effects.
Qanimationgroup
Animation combination: the animation combination does not have any attribute to participate in the animation, but it does change with time.
You can add a series of animations to an animation group. There are two relationships between the animations: parallel and serial. Qparallanimationgroup is used in parallel, and qsequentialanimationgroup is used in serial.
BTW
The animation framework of QT is still relatively scientific and used in combination with the state machine framework. The state machine framework is empty.
Reference: http://qt-project.org/doc/qt-4.8/animation-overview.html