Touch events
In this section, we will learn how to develop a touch-driven application that runs on mobile devices using Qt Quick.
How to do it…
Let’s get started by following this step-by-step guide:
- Create a new Qt Quick application project.
- In Qt Design Studio, click on the + button on the Assets Window. Then, select
tux.png
and add it to the project as follows:
Figure 9.17 – Import tux.png into your project
- Next, open up
Screen01.ui.qml
. Drag an image widget from the Components window to the canvas. Then, set the source of the image totux.png
and set its fillMode to PreserveAspectFit. After that, set its width to200
and its height to 220
. - Make sure that both the mouse area widget and the image widget are exported as the alias properties of the root item by clicking on the small icon beside their respective widget name.
- After that, switch over to the script editor by clicking on the Edit button...