The States example shows how to use the Qt state machine to play animations.
Example project @ code.qt.io