To learn how to render animation in QML, follow this example:
- Create a Qt Quick Application - Empty project. Then, right-click on the Resources icon under our project panel and add tux.png into our project's resource:
- Open up main.qml and change the window size to 650 x 650. We will also add id to the Window item and name it window:
Window { id: window visible: true width: 650 height: 650
- Add the following code inside the Window item:
property int frame: 0;onAfterRendering: { frame++; }Timer { id: timer interval: 1000 running: true repeat: true onTriggered: { frame = 0; }}
- Right after that, add Repeater and Image under ...