From 70113ef66b245e58ce12e2a9d26268e2eaeb3a42 Mon Sep 17 00:00:00 2001 From: Jan Arve Saether Date: Fri, 23 Dec 2016 15:30:33 +0100 Subject: Don't assume that target is the parent item To summarize: A pointer handler always gets its pointer events from its parent item. It applies its effect (drag, pinch, ...) on the item referenced to by the target property. By default, target refers to the parent, but that is not always the case. In addition to this we also have to handle the case when the target is null Change-Id: If62108abf0aeb713906bf88472ad9a32a74efff6 Reviewed-by: Shawn Rutledge --- src/quick/handlers/qquickdraghandler.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/quick/handlers/qquickdraghandler.cpp') diff --git a/src/quick/handlers/qquickdraghandler.cpp b/src/quick/handlers/qquickdraghandler.cpp index f2a1b74d6c..a1c3486bd0 100644 --- a/src/quick/handlers/qquickdraghandler.cpp +++ b/src/quick/handlers/qquickdraghandler.cpp @@ -76,9 +76,6 @@ bool QQuickDragHandler::wantsEventPoint(QQuickEventPoint *point) void QQuickDragHandler::handleEventPoint(QQuickEventPoint *point) { - // If there's no target or the target has no parent, we shouldn't be dragging - if (!target() || !target()->parentItem()) - return; point->setAccepted(); switch (point->state()) { case QQuickEventPoint::Pressed: -- cgit v1.2.3