diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2016-11-15 14:41:34 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2016-11-17 09:59:50 +0000 |
commit | aa1a8444991aee671981a99d1e08c5e1cb02c94a (patch) | |
tree | 0ae0a80370b088b5a9a07d3293fa0bd825f74e5c /src/quicktemplates2 | |
parent | 870dd9083eb89b74ce6ce713577e81dcad1f4b34 (diff) |
QQuickAbstractButton: fix auto-repeat
Don't cancel auto-repeat on the tiniest mouse/touch move, but keep
repeating until moved outside the button.
The test has been changed so that the exact amount of repeats does
not matter, as long as it repeats. This is because waits are not
reliable in a busy CI environment. Sometimes waits can take longer,
timer events get queued, and we get an unexpected burst of repeats.
Change-Id: Ic473e04c4d15a0826c8adf460c69507e64590d99
Task-number: QTBUG-57085
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2')
-rw-r--r-- | src/quicktemplates2/qquickabstractbutton.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/quicktemplates2/qquickabstractbutton.cpp b/src/quicktemplates2/qquickabstractbutton.cpp index d922cfb1..75854d04 100644 --- a/src/quicktemplates2/qquickabstractbutton.cpp +++ b/src/quicktemplates2/qquickabstractbutton.cpp @@ -527,7 +527,7 @@ void QQuickAbstractButton::mouseMoveEvent(QMouseEvent *event) QQuickControl::mouseMoveEvent(event); setPressed(d->keepPressed || contains(event->pos())); - if (d->autoRepeat) + if (!d->pressed && d->autoRepeat) d->stopPressRepeat(); else if (d->holdTimer > 0 && (!d->pressed || QLineF(d->pressPoint, event->localPos()).length() > QGuiApplication::styleHints()->startDragDistance())) d->stopPressAndHold(); |