import QtQuick import QtQuick.Controls import QtQuick.Layouts Window { width: 860 height: 480 visible: true title: qsTr("Hello World") Rectangle { anchors.fill: parent color: "white" TapHandler { onTapped: console.log("_") onSingleTapped: console.log("__") onDoubleTapped: console.log("___") } RowLayout { anchors.centerIn: parent Rectangle { color: "blue" width: 200 height: 200 Text { anchors.centerIn: parent text: "Default (DragThreshold)" } TapHandler { gesturePolicy: TapHandler.DragThreshold onTapped: console.log("tapped") onSingleTapped: console.log("single tapped") onDoubleTapped: console.log("double tapped") } } Rectangle { color: "red" width: 200 height: 200 Text { anchors.centerIn: parent text: "WithinBounds" } TapHandler { gesturePolicy: TapHandler.WithinBounds onTapped: console.log("tapped") onSingleTapped: console.log("single tapped") onDoubleTapped: console.log("double tapped") } } Rectangle { color: "green" width: 200 height: 200 Text { anchors.centerIn: parent text: "ReleaseWithinBounds" } TapHandler { gesturePolicy: TapHandler.ReleaseWithinBounds onTapped: console.log("tapped") onSingleTapped: console.log("single tapped") onDoubleTapped: console.log("double tapped") } } Rectangle { color: "yellow" width: 200 height: 200 Text { anchors.centerIn: parent text: "DragWithinBounds" } TapHandler { gesturePolicy: TapHandler.DragWithinBounds onTapped: console.log("tapped") onSingleTapped: console.log("single tapped") onDoubleTapped: console.log("double tapped") } } } } }