![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
#include <qwindowsdirectmanipulation.h>
Classes | |
| class | UpdatePump |
Public Types | |
| using | QPointingDevicePtr = QSharedPointer<QPointingDevice> |
Public Member Functions | |
| ~QWindowsDirectManipulation () | |
| void | registerWindow (QWindow *window, HWND hwnd) |
| void | unregisterWindow (HWND hwnd) |
| bool | handlePointerHitTest (HWND hwnd, WPARAM wParam) |
| const QPointingDevicePtr & | device () |
Static Public Member Functions | |
| static QWindowsDirectManipulation * | create () |
Friends | |
| class | QWindowsDirectManipulationViewport |
Translates Windows Precision Touchpad gestures into Qt events, using the Direct Manipulation API.
Windows reports touchpad gestures to legacy applications by synthesizing mouse wheel messages: two-finger scrolling arrives as WM_MOUSEWHEEL and WM_MOUSEHWHEEL with fine-grained deltas, and pinching arrives as Ctrl+WM_MOUSEWHEEL quantized to whole WHEEL_DELTA steps. Neither carries pixel deltas, gesture phases, or a real scale factor.
Direct Manipulation provides all of those: it reports a continuous content transform (translation and scale) together with a state machine that distinguishes an ongoing manipulation from the inertia which follows it. We turn the translation into QWheelEvent with pixel deltas and scroll phases (matching what the Cocoa plugin delivers for a trackpad), and the scale into QNativeGestureEvent with Qt::ZoomNativeGesture, wrapped in Qt::BeginNativeGesture and Qt::EndNativeGesture (matching the XCB plugin).
Handing a contact over to Direct Manipulation stops Windows from synthesizing the legacy wheel messages for it, so gestures are not delivered twice. A mouse wheel is unaffected and keeps arriving as WM_MOUSEWHEEL, and touch screens and pens are left to QWindowsPointerHandler.
Rotation is not available: DIRECTMANIPULATION_CONFIGURATION has no rotation flag, and the content transform Direct Manipulation reports is always a uniform scale plus a translation. Multi-finger swipes are consumed by the shell (task view, virtual desktop switching) and never reach the application, so Qt::SwipeNativeGesture cannot be supported either.
Definition at line 55 of file qwindowsdirectmanipulation.h.
Definition at line 59 of file qwindowsdirectmanipulation.h.
| QWindowsDirectManipulation::~QWindowsDirectManipulation | ( | ) |
Definition at line 469 of file qwindowsdirectmanipulation.cpp.
|
static |
Definition at line 444 of file qwindowsdirectmanipulation.cpp.
| const QWindowsDirectManipulation::QPointingDevicePtr & QWindowsDirectManipulation::device | ( | ) |
Definition at line 515 of file qwindowsdirectmanipulation.cpp.
| bool QWindowsDirectManipulation::handlePointerHitTest | ( | HWND | hwnd, |
| WPARAM | wParam ) |
Definition at line 502 of file qwindowsdirectmanipulation.cpp.
Definition at line 476 of file qwindowsdirectmanipulation.cpp.
| void QWindowsDirectManipulation::unregisterWindow | ( | HWND | hwnd | ) |
Definition at line 496 of file qwindowsdirectmanipulation.cpp.
|
friend |
Definition at line 80 of file qwindowsdirectmanipulation.h.