summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2009-08-21 08:45:04 (GMT)
committerBradley T. Hughes <bradley.hughes@nokia.com>2009-08-21 08:48:27 (GMT)
commit8280ed177d798aeaf82868ba6c7c8c4250051f1d (patch)
tree43d5e2cf595645591b0387c1209ed222ddca991e
parent499702455e21df61fc7a91d3b3c2b1ffaa0d4246 (diff)
downloadQt-8280ed177d798aeaf82868ba6c7c8c4250051f1d.zip
Qt-8280ed177d798aeaf82868ba6c7c8c4250051f1d.tar.gz
Qt-8280ed177d798aeaf82868ba6c7c8c4250051f1d.tar.bz2
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
-rw-r--r--src/gui/widgets/qabstractscrollarea.cpp7
1 files changed, 7 insertions, 0 deletions
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