aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickflickable.cpp
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2018-07-24 16:15:06 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2018-07-26 16:32:05 +0000
commitcaa45b4fe8b63f4be87b63b33595f65a0f44230e (patch)
treef401886962d5a249de22f86f5bbb50be40b524ed /src/quick/items/qquickflickable.cpp
parent315e0781b0890711b8a7def52f26e33c47c586dc (diff)
Flickable: never react to a QMouseEvent with no buttons pressed
If a Flickable contains an Item with a HoverHandler and a DragHandler, and you drag it and release it, then during the next mouse move events, since Flickable is able to filter those while they are being sent to the HoverHandler, it would grab the mouse. Suddenly you'd be flicking even with no mouse buttons pressed. I think I've seen similar behavior in other scenarios too, at some point. Change-Id: If79c8af2b62dc69f085513e0b7c8bf9b4d504572 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'src/quick/items/qquickflickable.cpp')
-rw-r--r--src/quick/items/qquickflickable.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/quick/items/qquickflickable.cpp b/src/quick/items/qquickflickable.cpp
index b47d055ca4..de3f835dc0 100644
--- a/src/quick/items/qquickflickable.cpp
+++ b/src/quick/items/qquickflickable.cpp
@@ -1308,7 +1308,7 @@ void QQuickFlickablePrivate::drag(qint64 currentTimestamp, QEvent::Type eventTyp
void QQuickFlickablePrivate::handleMouseMoveEvent(QMouseEvent *event)
{
Q_Q(QQuickFlickable);
- if (!interactive || lastPosTime == -1)
+ if (!interactive || lastPosTime == -1 || event->buttons() == Qt::NoButton)
return;
qint64 currentTimestamp = computeCurrentTime(event);