aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
diff options
context:
space:
mode:
Diffstat (limited to 'src/quick')
-rw-r--r--src/quick/handlers/qquicktaphandler.cpp3
-rw-r--r--src/quick/items/qquickitem.cpp15
2 files changed, 13 insertions, 5 deletions
diff --git a/src/quick/handlers/qquicktaphandler.cpp b/src/quick/handlers/qquicktaphandler.cpp
index c8525cfcb0..e71738c2d2 100644
--- a/src/quick/handlers/qquicktaphandler.cpp
+++ b/src/quick/handlers/qquicktaphandler.cpp
@@ -259,7 +259,8 @@ void QQuickTapHandler::setGesturePolicy(QQuickTapHandler::GesturePolicy gestureP
void QQuickTapHandler::setPressed(bool press, bool cancel, QPointerEvent *event, QEventPoint &point)
{
if (m_pressed != press) {
- qCDebug(lcTapHandler) << objectName() << "pressed" << m_pressed << "->" << press << (cancel ? "CANCEL" : "") << point;
+ qCDebug(lcTapHandler) << objectName() << "pressed" << m_pressed << "->" << press
+ << (cancel ? "CANCEL" : "") << point << "gp" << m_gesturePolicy;
m_pressed = press;
connectPreRenderSignal(press);
updateTimeHeld();
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
index a8cb45a891..ccd1168278 100644
--- a/src/quick/items/qquickitem.cpp
+++ b/src/quick/items/qquickitem.cpp
@@ -8377,9 +8377,9 @@ QQuickItemLayer *QQuickItemPrivate::layer() const
coordinate system.
Returns an invalid event with type \l QEvent::None if all points are
- stationary, or there are no points inside the item, or none of the points
- were pressed inside and the item was not grabbing any of them and
- \a isFiltering is false.
+ stationary; or there are no points inside the item; or none of the points
+ were pressed inside, neither the item nor any of its handlers is grabbing
+ any of them, and \a isFiltering is false.
When \a isFiltering is true, it is assumed that the item cares about all
points which are inside its bounds, because most filtering items need to
@@ -8397,11 +8397,18 @@ void QQuickItemPrivate::localizedTouchEvent(const QTouchEvent *event, bool isFil
for (auto &p : event->points()) {
if (p.isAccepted())
continue;
- // include points where item is the grabber
+
+ // include points where item is the grabber, or if any of its handlers is the grabber while some parent is filtering
auto pointGrabber = event->exclusiveGrabber(p);
bool isGrabber = (pointGrabber == q);
+ if (!isGrabber && pointGrabber && isFiltering) {
+ auto handlerGrabber = qmlobject_cast<QQuickPointerHandler *>(pointGrabber);
+ if (handlerGrabber && handlerGrabber->parentItem() == q)
+ isGrabber = true;
+ }
if (isGrabber)
anyGrabber = true;
+
// include points inside the bounds if no other item is the grabber or if the item is filtering
const auto localPos = q->mapFromScene(p.scenePosition());
bool isInside = q->contains(localPos);