QWheelEvent high-resolution delta support.
authorMorten Johan Sorvig <morten.sorvig@nokia.com>
Mon, 9 Jan 2012 10:25:40 +0000 (11:25 +0100)
committerQt by Nokia <qt-info@nokia.com>
Fri, 24 Feb 2012 13:55:06 +0000 (14:55 +0100)
commit5a2efb490bc3549ef42420a0dafcf22072785e0d
tree5e0dc4396301e791fda198e9a11448532bc1aeec
parente8952aba2914722b0ad0e6f07e2193ead7f2e39d
QWheelEvent high-resolution delta support.

Support pixel-based deltas as well as sending
dx and dy values in the same event. Keep source and
behavior compatibility with Qt 4.

New API:
QPoint pixelDelta() const
QPoint angleDelta() const

Deprecate delta() and orientation().

Both pixel-based deltas and combined updates are
necessary for smooth trackpad-based scrolling on
OS X.

Qt 4 compatible behavior is achieved by sending an
extra wheel event in cases where the initial event
has a combined dx and dy update. This extra event
sends dx in delta() and orientation(), with pixelDelta()
and angleDelta() set to null.

Modify the Cocoa implementation to provide pixel
deltas. It is expected that not all platforms can
provide these. Angle deltas will always be available.

Change-Id: I20c10f0df338ddcd6a3f7a4d40949ed5ae3b4795
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
14 files changed:
doc/src/snippets/code/src_gui_kernel_qevent.cpp
src/gui/kernel/qevent.cpp
src/gui/kernel/qevent.h
src/gui/kernel/qguiapplication.cpp
src/gui/kernel/qwindowsysteminterface_qpa.cpp
src/gui/kernel/qwindowsysteminterface_qpa.h
src/gui/kernel/qwindowsysteminterface_qpa_p.h
src/plugins/platforms/cocoa/qnsview.mm
src/widgets/kernel/qapplication.cpp
src/widgets/kernel/qwidgetwindow_qpa.cpp
tests/manual/cocoa/wheelevent/main.cpp [new file with mode: 0644]
tests/manual/cocoa/wheelevent/wheelevent.pro [new file with mode: 0644]
tests/manual/cocoa/wheelevent/window.cpp [new file with mode: 0644]
tests/manual/cocoa/wheelevent/window.h [new file with mode: 0644]