aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickwindow.cpp
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2020-10-28 23:21:22 +0100
committerShawn Rutledge <shawn.rutledge@qt.io>2020-10-29 13:25:46 +0100
commit5077eb43476b5a4e1bf96db9a37838f934fc036a (patch)
treee8357f814ca3ca00b5bcbb7bb7d9231bd43f77e6 /src/quick/items/qquickwindow.cpp
parentf7da9ffd3a4939b29ade8c3a467d5bc1726cae99 (diff)
Accept a mouse event's point if event is accepted after visiting item
When event handling code explicitly calls QPointerEvent->setAccepted(), all points get accepted, because that function is virtual now and makes it so. But the event is pre-accepted before delivery, because by tradition, the item must ignore the event if it doesn't handle it, but is not required to accept if it does handle it. Then in deliverPressOrReleaseEvent() (and other places) we check allPointsAccepted(), in case the event is a touch event and some item chooses to handle only a subset of the points. So it was not OK to remove this line that keeps them in sync after tradtional mouse delivery, which was added in 47ee54455beb1a063515041f85b4c216132491b3. The result was that delivery "kept going" past items that would neither accept() nor ignore() the mouse event, such that items further down could steal the grab, etc. In this case it was the ComboBox itself that received the press event, stole the grab from the TextField, and so the TextField did not get the mouse move and release that would select a range of text. Amends e783ef04fbbaa9a53121a6f575414b48043a10d2. Fixes: QTBUG-87947 Change-Id: Ib856d58a59c798c7bbfc5a222e2462a839fc2bdd Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quick/items/qquickwindow.cpp')
-rw-r--r--src/quick/items/qquickwindow.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index a054f9891e..ccc79c5f56 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -2882,6 +2882,7 @@ void QQuickWindowPrivate::deliverMatchingPointsToItem(QQuickItem *item, bool isG
} else if (item->isEnabled() && item->isVisible()) {
pointerEvent->setExclusiveGrabber(point, item);
}
+ point.setAccepted(true);
}
return;
}