Qt5 C++ GUI Programming Cookbook
上QQ阅读APP看书,第一时间看更新

There's more…

Qt allows us to create multiple animations and group them into an animation group. A group is usually responsible for managing the state of its animations (that is, it decides when to start, stop, resume, and pause them). Currently, Qt provides two types of class for animation groups, QParallelAnimationGroup and QSequentialAnimationGroup:

  • QParallelAnimationGroup: As its name implies, a parallel animation group runs all of the animations in its group at the same time. The group is deemed finished when the longest-lasting animation has finished running.
  • QSequentialAnimationGroup: A sequential animation group runs its animations in sequence, meaning it will only run a single animation at a time and only play the next animation when the current one has finished.