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…
- First of all, create a new Qt Quick application project. 
- In Qt Creator, right-click on - qml.qrcand select Open in Editor. Then, click Add | Add Files and add- tux.pngto the project: 
- Next, open up - MainForm.ui.qml. Drag an image widget from the Library window to the canvas. Then, set the source of the image to- tux.pngand set its- fillmodeto- PreserveAspectFit. After that, set its- widthto- 200and its- heightto- 220.
- Make sure both the mouse area widget and the image widget are exported as alias properties of the root item by clicking on the small icon besides their respective widget name. 
- After that, switch over to the Script Editor by clicking on the Edit button on the side bar located at the left side of the editor. We need to change the mouse area widget to a multi-point touch area widget, like so: - MultiPointTouchArea { id: touchArea anchors.fill: parent...
 
                                             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
     
         
                 
                 
                 
                 
                 
                 
                 
                 
                