aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2020-08-07 13:50:06 +0200
committerMitch Curtis <mitch.curtis@qt.io>2020-08-19 15:16:49 +0200
commit6f41c69c9bc5a0ce59444e40d3a55018f7994743 (patch)
tree14a30f03160064058fad9913f3b17367193c2062 /src/quicktemplates2
parentf3a64b13725081eb94b05dbeb5f68a2298c9163e (diff)
SwipeDelegate: don't allow calling close() when pressed
This conflicts with the behavior of SwipeDelegate. The released() or clicked() signals should be used instead. Fixes: QTBUG-85804 Pick-to: 5.15 Change-Id: I06111b63941f54c06f0e1b828d17264f37d765d5 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Diffstat (limited to 'src/quicktemplates2')
-rw-r--r--src/quicktemplates2/qquickswipedelegate.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/quicktemplates2/qquickswipedelegate.cpp b/src/quicktemplates2/qquickswipedelegate.cpp
index 3669ce05..4b16609d 100644
--- a/src/quicktemplates2/qquickswipedelegate.cpp
+++ b/src/quicktemplates2/qquickswipedelegate.cpp
@@ -697,6 +697,11 @@ void QQuickSwipe::close()
if (qFuzzyIsNull(d->position))
return;
+ if (d->control->isPressed()) {
+ // We don't support closing when we're pressed; release() or clicked() should be used instead.
+ return;
+ }
+
d->beginTransition(0.0);
d->wasComplete = false;
d->positionBeforePress = 0.0;