aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2019-10-30 16:21:16 +0100
committerMitch Curtis <mitch.curtis@qt.io>2021-06-16 18:41:11 +0200
commit887af04857f366c393512573cafebccde2678d6d (patch)
treec39bfb98ce81e2392fc486c76a3aacee188ea238 /src/quicktemplates2
parent6dc95399797de4ec27984956df1fa587f4eb18ba (diff)
Fix SwipeDelegate losing swipes to parent flickables
Use a smaller threshold than Flickable so that it doesn't steal our events. Fixes: QTBUG-55705 Pick-to: 5.15 6.1 6.2 Change-Id: I7e985c27788818226a3158078d485ea12ddd7006 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/quicktemplates2')
-rw-r--r--src/quicktemplates2/qquickswipedelegate.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/quicktemplates2/qquickswipedelegate.cpp b/src/quicktemplates2/qquickswipedelegate.cpp
index 68a50f7a..5e208fb9 100644
--- a/src/quicktemplates2/qquickswipedelegate.cpp
+++ b/src/quicktemplates2/qquickswipedelegate.cpp
@@ -811,9 +811,10 @@ bool QQuickSwipeDelegatePrivate::handleMouseMoveEvent(QQuickItem *item, QMouseEv
const QPointF mappedEventPos = item->mapToItem(q, event->position().toPoint());
const qreal distance = (mappedEventPos - pressPoint).x();
if (!q->keepMouseGrab()) {
- // Taken from QQuickDrawerPrivate::grabMouse; see comments there.
- int threshold = qMax(20, QGuiApplication::styleHints()->startDragDistance() + 5);
- const bool overThreshold = QQuickWindowPrivate::dragOverThreshold(distance, Qt::XAxis, event, threshold);
+ // We used to use the custom threshold that QQuickDrawerPrivate::grabMouse used,
+ // but since it's larger than what Flickable uses, it results in Flickable
+ // stealing events from us (QTBUG-50045), so now we use the default.
+ const bool overThreshold = QQuickWindowPrivate::dragOverThreshold(distance, Qt::XAxis, event);
if (window && overThreshold) {
QQuickItem *grabber = q->window()->mouseGrabberItem();
if (!grabber || !grabber->keepMouseGrab()) {