diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2020-08-07 13:50:06 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2020-08-19 14:01:30 +0000 |
commit | 1bdb56ff9571dfbf4b7bd52b9d8a45ca00f4ecac (patch) | |
tree | b8c9ebd1a1e4a6a5b4216662ef136005933b901e /src | |
parent | 2ee9e0c2d8cb8dc066f15ef488630d455947fd6a (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
Change-Id: I06111b63941f54c06f0e1b828d17264f37d765d5
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
(cherry picked from commit 6f41c69c9bc5a0ce59444e40d3a55018f7994743)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/quicktemplates2/qquickswipedelegate.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/quicktemplates2/qquickswipedelegate.cpp b/src/quicktemplates2/qquickswipedelegate.cpp index ad3865ff..c6214243 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; |