How it works...
You can see that the click() event of the Push Button widget with the objectName property, pushButtonMoveDown, is connected to the startAnimation method; when the push button is clicked, the startAnimation method will be invoked. In the startAnimation method, you create an object of the QPropertyAnimation class and name it anim. While creating the QPropertyAnimation instance, you pass two arguments: the first is the Label widget to which you want to apply the animation, and the second is the property that defines the object's attribute to which you want to apply the animation to the object's attribute. Because you want to apply an animation to the ball's geometry, you pass b"geometry" as the second attribute while defining ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access