In this recipe, you will understand how a basic animation is applied on an object. This recipe will consist of a push button and a ball, and when the push button is pressed, the ball will start animating towards the ground.
Making a ball move down on the click of a button
How to do it...
To make this recipe, we will be making use of the QPropertyAnimation class. The setStartValue() and setEndValue() methods of the QPropertyAnimation class will be used to define the coordinates where the animation needs to start and end, respectively. The setDuration() method will be invoked to specify the delay in milliseconds between every animation move. The following is the step-by-step procedure to apply an animation:
- Create a new...