About the animation framework of QT

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.