What just happened?

You already know how to set up a single property animation, so we omitted the code for it. After setting up both animations, we add them to the group animation by calling addAnimation() on the group, while passing a pointer to the animation we would like to add. Then, when we start the group; QParallelAnimationGroup ensures that all assigned animations start at the same time.

When both animations have finished, group will emit the finished() signal. We connected that signal to the deleteLater() slot of our class so that the coin object gets deleted when it's no longer visible. This handy slot is declared in the QObject class and is useful in many cases.

In some cases, you may want to stop an animation. You can do that by calling the stop() method. It's also possible to pause and resume an animation using pause() and resume(). Using these methods on a QParallelAnimationGroup will affect all transformations added to that group.