diff options
author | Konstantin Ritt <ritt.ks@gmail.com> | 2016-04-01 19:18:31 +0400 |
---|---|---|
committer | Konstantin Ritt <ritt.ks@gmail.com> | 2016-04-07 16:48:17 +0000 |
commit | 4b0e963598eff597c408ea4107430399c916679b (patch) | |
tree | 8df893a4f19dbb1818ae82cc4bbb164fe4c74e3d /src | |
parent | 323d0bdba7ff88f525ca880fa249cfc65030aa8b (diff) |
Stop Button's pressAndHold once the button is not pressed anymore
A custom-shaped Button's contains() could return false just anywhere
within the content rect, so we should handle this exactly the same way
as for the drag threshold overrun.
Change-Id: Ie1665933be228334c6f95e97bd42e2dcd892b947
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/templates/qquickabstractbutton.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/templates/qquickabstractbutton.cpp b/src/templates/qquickabstractbutton.cpp index 94c39e48..44fa30b1 100644 --- a/src/templates/qquickabstractbutton.cpp +++ b/src/templates/qquickabstractbutton.cpp @@ -514,7 +514,7 @@ void QQuickAbstractButton::mouseMoveEvent(QMouseEvent *event) if (d->autoRepeat) d->stopPressRepeat(); - else if (d->holdTimer > 0 && QLineF(d->pressPoint, event->localPos()).length() > QGuiApplication::styleHints()->startDragDistance()) + else if (d->holdTimer > 0 && (!d->pressed || QLineF(d->pressPoint, event->localPos()).length() > QGuiApplication::styleHints()->startDragDistance())) d->stopPressAndHold(); } |