From ab91e7fa02a562d80fd0747f28a60e00c3b45a01 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Tue, 2 May 2017 11:34:19 +0200 Subject: Default QQuickItem::acceptTouchEvents to true until Qt 6 This is a partial revert of 1457df74f4c1d770e1e820de8cd082be1bd2489e to avoid making a mandatory API change so soon. Change-Id: I05040579fa36d3dc5ef7616861f6d17adf500d2c Reviewed-by: Shawn Rutledge --- src/quick/items/qquickwindow.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/quick/items/qquickwindow.cpp') diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 289e1eabec..9c889d54f5 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -2668,9 +2668,15 @@ void QQuickWindowPrivate::updateFilteringParentItems(const QVector } filteringParentItems.clear(); for (QQuickItem *item : targetItems) { +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + bool acceptsTouchEvents = item->acceptTouchEvents(); +#else + // In versions prior to Qt 6, we can't trust item->acceptTouchEvents() here, because it defaults to true. + bool acceptsTouchEvents = false; +#endif QQuickItemPrivate *itemPriv = QQuickItemPrivate::get(item); - // If the item neither handles events nor has handlers which do, then it will never be a receiver, so filtering is irrelevant - if (!item->acceptedMouseButtons() && !item->acceptTouchEvents() && + // If the item neither handles events nor has handlers which do, then it will never be a receiver, so filtering is irrelevant. + if (!item->acceptedMouseButtons() && !acceptsTouchEvents && !(itemPriv->extra.isAllocated() && !itemPriv->extra->pointerHandlers.isEmpty())) continue; QQuickItem *parent = item->parentItem(); -- cgit v1.2.3