Fix TapAndHoldGesture (others) for QWidgets
authorRafael Roquetto <rafael.roquetto.qnx@kdab.com>
Mon, 5 Nov 2012 23:18:02 +0000 (21:18 -0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Thu, 8 Nov 2012 14:05:26 +0000 (15:05 +0100)
commit602ea84f44ab507e5603ed0808bf4a5dd145d773
treef64b7f35261b3ee7b13d70460e081be6e4506756
parentd2e5c7787e82fe3157ca3100a0e465a0ed7c5685
Fix TapAndHoldGesture (others) for QWidgets

After the migration to QPA, touch events usually have a QWindow as a receiver,
unlike Qt4 where receivers were QWidgets. This broke QGestureManager and
gestures such as the TapAndHoldGesture, because
QGestureManager::filterEvent(QWidget *, QEvent *) was never called. Since the
receivers are now of QWindow type, QGestureManager::filterEvent(QObject *,
QEvent *) gets called instead, always returning false. This has several side
effects, one of them was causing the TapAndHold gesture to time out, because
it never got a TouchEnd event (and thus it thought that the touch was still
going on, even though it was not). This patch ensures that if a gesture event is
meant to be delivered to a QWidget, the right event filter method is called.

Change-Id: I1df5f763fe6c4d8db0058adbd17d23d70b4988fe
Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Denis Dzyubenko <denis@ddenis.info>
src/widgets/kernel/qgesturemanager.cpp