aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/handlers/qquickdraghandler.cpp
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2016-09-22 10:26:14 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2016-12-09 22:49:53 +0000
commit2816d05c7b254e501562b96786936f59d9b45cea (patch)
tree7b41b2a1eb71eea1acfebc869679abe863efb08b /src/quick/handlers/qquickdraghandler.cpp
parent9c9bb1b97ff80bf5469ca15d34bd4ccfeefedf9c (diff)
DragHandler: override wantsEventPoint to retain interest out of bounds
In any use case where the movement is constrained, as in a slider or scrollbar, it's possible to keep dragging even when the eventpoint is out of bounds. QQuickPointerSingleHandler::wantsEventPoint() returns false when the point is out of bounds, so we have to override it. Change-Id: Id80f614d6c38f28e6520ee8eacf7649f7317a5ef Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'src/quick/handlers/qquickdraghandler.cpp')
-rw-r--r--src/quick/handlers/qquickdraghandler.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/quick/handlers/qquickdraghandler.cpp b/src/quick/handlers/qquickdraghandler.cpp
index 0b77bb46c6..dadf8bba04 100644
--- a/src/quick/handlers/qquickdraghandler.cpp
+++ b/src/quick/handlers/qquickdraghandler.cpp
@@ -67,6 +67,13 @@ QQuickDragHandler::~QQuickDragHandler()
{
}
+bool QQuickDragHandler::wantsEventPoint(QQuickEventPoint *point)
+{
+ // If we've already been interested in a point, stay interested, even if it has strayed outside bounds.
+ return ((point->state() != QQuickEventPoint::Pressed && currentPointId() == point->pointId())
+ || QQuickPointerSingleHandler::wantsEventPoint(point));
+}
+
void QQuickDragHandler::handleEventPoint(QQuickEventPoint *point)
{
// If there's no target or the target has no parent, we shouldn't be dragging