aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickflickable.cpp
diff options
context:
space:
mode:
authorTarja Sundqvist <tarja.sundqvist@qt.io>2022-09-12 18:29:45 +0300
committerTarja Sundqvist <tarja.sundqvist@qt.io>2022-09-12 18:29:45 +0300
commitda0aac1057552048f59075beb31861a6cc076684 (patch)
tree020cd8784f01248ea051bbf70254b8bcb3100a23 /src/quick/items/qquickflickable.cpp
parentf274d775774b78f6217c9770ae87045d969acbe1 (diff)
parent4757cac470edbeaeaceca4e63075d9f1139f546b (diff)
Merge remote-tracking branch 'origin/tqtc/lts-5.15.7' into tqtc/lts-5.15-opensourcev5.15.7-lts-lgpl
Diffstat (limited to 'src/quick/items/qquickflickable.cpp')
-rw-r--r--src/quick/items/qquickflickable.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/quick/items/qquickflickable.cpp b/src/quick/items/qquickflickable.cpp
index 9a68be4c49..e12e85db64 100644
--- a/src/quick/items/qquickflickable.cpp
+++ b/src/quick/items/qquickflickable.cpp
@@ -2445,7 +2445,20 @@ bool QQuickFlickable::filterMouseEvent(QQuickItem *receiver, QMouseEvent *event)
bool QQuickFlickable::childMouseEventFilter(QQuickItem *i, QEvent *e)
{
Q_D(QQuickFlickable);
- if (!isVisible() || !isEnabled() || !isInteractive() || !d->wantsPointerEvent(e)) {
+ auto wantsPointerEvent_helper = [=]() {
+ bool wants = true;
+ if (e->type() >= QEvent::MouseButtonPress && e->type() <= QEvent::MouseMove) {
+ QMouseEvent *me = static_cast<QMouseEvent*>(e);
+ QPointF itemLocalPos = me->localPos();
+ me->setLocalPos(mapFromItem(i, itemLocalPos));
+ wants = d->wantsPointerEvent(e);
+ // re-localize event back to \a i before returning
+ me->setLocalPos(itemLocalPos);
+ }
+ return wants;
+ };
+
+ if (!isVisible() || !isEnabled() || !isInteractive() || !wantsPointerEvent_helper()) {
d->cancelInteraction();
return QQuickItem::childMouseEventFilter(i, e);
}