Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QWindowsDirectManipulation Class Reference

#include <qwindowsdirectmanipulation.h>

Collaboration diagram for QWindowsDirectManipulation:

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

Detailed Description

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.

Member Typedef Documentation

◆ QPointingDevicePtr

Constructor & Destructor Documentation

◆ ~QWindowsDirectManipulation()

QWindowsDirectManipulation::~QWindowsDirectManipulation ( )

Definition at line 469 of file qwindowsdirectmanipulation.cpp.

Member Function Documentation

◆ create()

QWindowsDirectManipulation * QWindowsDirectManipulation::create ( )
static

Definition at line 444 of file qwindowsdirectmanipulation.cpp.

◆ device()

const QWindowsDirectManipulation::QPointingDevicePtr & QWindowsDirectManipulation::device ( )

Definition at line 515 of file qwindowsdirectmanipulation.cpp.

◆ handlePointerHitTest()

bool QWindowsDirectManipulation::handlePointerHitTest ( HWND hwnd,
WPARAM wParam )

Definition at line 502 of file qwindowsdirectmanipulation.cpp.

◆ registerWindow()

void QWindowsDirectManipulation::registerWindow ( QWindow * window,
HWND hwnd )

Definition at line 476 of file qwindowsdirectmanipulation.cpp.

◆ unregisterWindow()

void QWindowsDirectManipulation::unregisterWindow ( HWND hwnd)

Definition at line 496 of file qwindowsdirectmanipulation.cpp.

◆ QWindowsDirectManipulationViewport

Definition at line 80 of file qwindowsdirectmanipulation.h.


The documentation for this class was generated from the following files: