aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquicklistview.cpp
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2020-10-07 14:35:56 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2020-10-08 10:13:27 +0200
commit9ce346411eb5bd71ae84647999030ae47c3c544a (patch)
treed382c8002dcc9005d9c0919951c24b599a129626 /src/quick/items/qquicklistview.cpp
parent8d9819734516a2fe0853acfd0b2cfd3364465c7a (diff)
Amend QQFlickablePrivate::wantsPointerEvent() to take QPointerEvent
...now that we're done with the cherry-pick to 5.15. Amends 6857ad3e686a5e2b45d28a7f47dca3210608da50. Task-number: QTBUG-74046 Task-number: QTBUG-85302 Change-Id: I3c2ec091976bcfc170ff58d8fcd226dcdf4c90d2 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/quick/items/qquicklistview.cpp')
-rw-r--r--src/quick/items/qquicklistview.cpp18
1 files changed, 3 insertions, 15 deletions
diff --git a/src/quick/items/qquicklistview.cpp b/src/quick/items/qquicklistview.cpp
index ced9e27855..420ab620ab 100644
--- a/src/quick/items/qquicklistview.cpp
+++ b/src/quick/items/qquicklistview.cpp
@@ -146,7 +146,7 @@ public:
void fixupHeader();
void fixupHeaderCompleted();
- bool wantsPointerEvent(const QEvent *event) override;
+ bool wantsPointerEvent(const QPointerEvent *event) override;
QQuickListView::Orientation orient;
qreal visiblePos;
@@ -3828,24 +3828,12 @@ QQuickListViewAttached *QQuickListView::qmlAttachedProperties(QObject *obj)
/*! \internal
Prevents clicking or dragging through floating headers (QTBUG-74046).
*/
-bool QQuickListViewPrivate::wantsPointerEvent(const QEvent *event)
+bool QQuickListViewPrivate::wantsPointerEvent(const QPointerEvent *event)
{
Q_Q(const QQuickListView);
bool ret = true;
- QPointF pos;
- // TODO switch not needed in Qt 6: use points().first().position()
- switch (event->type()) {
- case QEvent::Wheel:
- pos = static_cast<const QWheelEvent *>(event)->position();
- break;
- case QEvent::MouseButtonPress:
- pos = static_cast<const QMouseEvent *>(event)->position();
- break;
- default:
- break;
- }
-
+ QPointF pos = event->points().first().position();
if (!pos.isNull()) {
if (auto header = q->headerItem()) {
if (q->headerPositioning() != QQuickListView::InlineHeader &&