From 8280ed177d798aeaf82868ba6c7c8c4250051f1d Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Fri, 21 Aug 2009 10:45:04 +0200 Subject: Handle Touch* events in the same way as other input events in QAbstractScrollArea We send the Touch* events filtered from the viewport to the scroll area's default handler so that we can take advantage of the default handling in QWidget. But we also need to ignore Touch* events in QAbstractScrollArea::event() so that we don't get the events twice (once from the filter, and again if propagated). Reviewed-by: Richard Moe Gustavsen --- src/gui/widgets/qabstractscrollarea.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gui/widgets/qabstractscrollarea.cpp b/src/gui/widgets/qabstractscrollarea.cpp index 942df89..8428125 100644 --- a/src/gui/widgets/qabstractscrollarea.cpp +++ b/src/gui/widgets/qabstractscrollarea.cpp @@ -923,6 +923,10 @@ bool QAbstractScrollArea::event(QEvent *e) case QEvent::DragMove: case QEvent::DragLeave: #endif + // ignore touch events in case they have been propagated from the viewport + case QEvent::TouchBegin: + case QEvent::TouchUpdate: + case QEvent::TouchEnd: return false; case QEvent::StyleChange: case QEvent::LayoutDirectionChange: @@ -963,6 +967,9 @@ bool QAbstractScrollArea::viewportEvent(QEvent *e) case QEvent::MouseButtonPress: case QEvent::MouseButtonRelease: case QEvent::MouseButtonDblClick: + case QEvent::TouchBegin: + case QEvent::TouchUpdate: + case QEvent::TouchEnd: case QEvent::MouseMove: case QEvent::ContextMenu: #ifndef QT_NO_WHEELEVENT -- cgit v0.12