diff options
author | Shawn Rutledge <shawn.rutledge@digia.com> | 2016-02-01 16:10:35 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@theqtcompany.com> | 2016-02-02 14:57:25 +0000 |
commit | 1929fee8e17e9ca66e7fe08faa9ed9fa7fdbb127 (patch) | |
tree | fdb68eb626a71bd0ab07a5f2a02b76b3cf34c3e0 /src/quick/items/qquickflickable_p.h | |
parent | 666bc731a0ba930ca0cfda18daf836913fd91361 (diff) |
Flickable: ensure movementEnded after wheel/trackpad flick
In qtdeclarative/tests/manual/touch/flicktext.qml it was already clear
that the moving/movingVertically/Horizontally properties did not revert
to false after a trackpad flick on OS X. It turns out that the failure
to emit the movementEnded signal also caused a scrolling bug in ListView.
QQuickFlickable::wheelEvent() looks at event->phase(), but ScrollEnd is not
absolute: on OS X with a bluetooth trackpad, it happens once when the user's
fingers are lifted, then the "momentum" events occur with ScrollUpdate, and
then ScrollEnd happens again at the end of the momentum phase. But if the
user's fingers come to rest before being lifted, to stop the momentum, then
the ScrollEnd phase happens only once, and that's actually the end of
scrolling, flicking and movement, all at once. The events don't seem to
provide enough information to disambiguate these two cases; but if ScrollEnd
phase occurs, and then we don't receive any more events within some short
time interval, we can be pretty sure the scrolling really ended. So, use
a timer to check whether any more events have been received, a little later
after the ScrollEnd phase.
The movementEnded signal can now be emitted for several reasons: the
regular timeline ended movement, the velocityTimeline ended movement,
or the movementEndingTimer sent an event.
Also, when flicking with a physical mouse wheel, flickStarted was emitted
multiple times; now it will be emitted only once.
Task-number: QTBUG-47151
Change-Id: I534e99befbd9bf6af24c4ebdca73dd21964f1063
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Diffstat (limited to 'src/quick/items/qquickflickable_p.h')
-rw-r--r-- | src/quick/items/qquickflickable_p.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/quick/items/qquickflickable_p.h b/src/quick/items/qquickflickable_p.h index ac072f0e50..f1299ee4f2 100644 --- a/src/quick/items/qquickflickable_p.h +++ b/src/quick/items/qquickflickable_p.h @@ -253,6 +253,7 @@ protected Q_SLOTS: void movementStarting(); void movementEnding(); void movementEnding(bool hMovementEnding, bool vMovementEnding); + void velocityTimelineCompleted(); void timelineCompleted(); protected: |