From 94e2399425d863368627ecbafca105af10f0e123 Mon Sep 17 00:00:00 2001 From: Marco Allegretti Date: Wed, 8 Apr 2026 19:07:03 +0200 Subject: [PATCH] Add clicked() signal to SwipeArea Emit clicked() when a press-and-release occurs without any swipe movement. This allows consumers to distinguish taps from swipe gestures on the same surface. --- components/mobileshell/components/swipearea.cpp | 3 +++ components/mobileshell/components/swipearea.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/components/mobileshell/components/swipearea.cpp b/components/mobileshell/components/swipearea.cpp index 5ec21b7c..2401e1fb 100644 --- a/components/mobileshell/components/swipearea.cpp +++ b/components/mobileshell/components/swipearea.cpp @@ -309,6 +309,9 @@ void SwipeArea::handleReleaseEvent(QPointerEvent *event, QPointF point) // if we are in a swipe if (m_moving) { Q_EMIT swipeEnded(); + } else if (m_pressed) { + // No swipe occurred — this was a click/tap + Q_EMIT clicked(); } resetSwipe(); diff --git a/components/mobileshell/components/swipearea.h b/components/mobileshell/components/swipearea.h index a3bf899b..f34e78f7 100644 --- a/components/mobileshell/components/swipearea.h +++ b/components/mobileshell/components/swipearea.h @@ -63,6 +63,8 @@ Q_SIGNALS: void touchpadScrollEnded(); void touchpadScrollMove(qreal totalDeltaX, qreal totalDeltaY, qreal deltaX, qreal deltaY); + void clicked(); + protected: bool childMouseEventFilter(QQuickItem *item, QEvent *event) override; void mouseMoveEvent(QMouseEvent *event) override;