Fix mouse event distribution for Flickable with pressDelay
authorMatt Vogt <matthew.vogt@jollamobile.com>
Wed, 28 Nov 2012 22:35:00 +0000 (08:35 +1000)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Thu, 29 Nov 2012 05:39:10 +0000 (06:39 +0100)
commitd02131e743597b9bd3070d986c61a1c91ea8317a
tree03f747e256d3c9d86891786aadee79673a509dbe
parentb68d7ab0a52ea9e94a3e62767357e0c735727969
Fix mouse event distribution for Flickable with pressDelay

If an item responds to mouse events but does not accept them, it
can prevent the events from being processed by the correct item
further up the parent chain.  For example, a text item inside a
mouse area can wrongly consume a press event, so that the following
release event does not yield a click when processed by the mouse area.

Rather than speculatively assigning the mouse grab to items during
event filter processing, change Flickable to retain the grab for
the duration of the pressDelay and to release it during replay of
the press event.

Change-Id: Ied12b9643838a984c7026978047465c2830e55e4
Reviewed-by: Martin Jones <martin.jones@jollamobile.com>
src/quick/items/qquickflickable.cpp
src/quick/items/qquickflickable_p.h
src/quick/items/qquickflickable_p_p.h
tests/auto/quick/qquickflickable/data/nestedPressDelay.qml
tests/auto/quick/qquickflickable/data/pressDelay.qml [new file with mode: 0644]
tests/auto/quick/qquickflickable/tst_qquickflickable.cpp