Rendering and animation
When it comes to an application that renders graphics and animation, good performance is critical. Users can easily notice performance issues when graphics are not animated smoothly on screen. In the following example, we will look at how we can further optimize a graphics-heavy Qt Quick application.
How to do it…
To learn how to render animation in QML, follow this example:
- Create a Qt Quick Application project. Then, right-click on the Resources icon under our project panel and add
tux.png
to our project’s resources:
Figure 14.12 – Include main.qml and tux.png into your project resources
- Open up main.qml and change the window size to
650
x650
. We will also addid
to thewindow
item and name itwindow
:Window { id: window visible: true width: 650 height: 650
- Add the following code inside...