From 6e1b10c09ad19ba20a60d320afb40575204430d5 Mon Sep 17 00:00:00 2001 From: Matthias Rauter Date: Mon, 27 Feb 2023 10:51:33 +0100 Subject: Replace MouseArea with TapHandler in Planespotter example Change-Id: Ib5e02e914090a22183230cdd128fbcba608d82fc Reviewed-by: Volker Hilsheimer (cherry picked from commit 07ac2096ce088c6ce3e5d692e5048b89364173af) Reviewed-by: Qt Cherry-pick Bot --- examples/location/planespotter/doc/src/planespotter.qdoc | 2 +- examples/location/planespotter/planespotter.qml | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/examples/location/planespotter/doc/src/planespotter.qdoc b/examples/location/planespotter/doc/src/planespotter.qdoc index bed5f597..394ad1d0 100644 --- a/examples/location/planespotter/doc/src/planespotter.qdoc +++ b/examples/location/planespotter/doc/src/planespotter.qdoc @@ -111,7 +111,7 @@ \snippet planespotter/planespotter.qml QmlPlane1 - The \l MouseArea of the QML plane implements the logic for the course setting + The \l TapHandler of the QML plane implements the logic for the course setting and starts the animation when required. \snippet planespotter/planespotter.qml QmlPlane2 diff --git a/examples/location/planespotter/planespotter.qml b/examples/location/planespotter/planespotter.qml index 89384d5d..3cb3085b 100644 --- a/examples/location/planespotter/planespotter.qml +++ b/examples/location/planespotter/planespotter.qml @@ -64,9 +64,8 @@ Window { } //! [QmlPlane2] - MouseArea { - anchors.fill: parent - onClicked: { + TapHandler { + onTapped: { if (qmlPlaneAnimation.running) { console.log("Plane still in the air."); return; @@ -96,9 +95,8 @@ Window { pilotName: "C++" coordinate: berlin2London.position - MouseArea { - anchors.fill: parent - onClicked: { + TapHandler { + onTapped: { if (cppPlaneAnimation.running || berlin2London.isFlying()) { console.log("Plane still in the air."); return; -- cgit v1.2.3