diff options
author | Ben Fletcher <ben.fletcher@me.com> | 2023-03-11 22:10:12 -0800 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2023-04-06 21:00:22 +0200 |
commit | 13d2a4e31dbef2b48ebc44978368539ba96fded8 (patch) | |
tree | 683be4b4010fe01d54b1fd4e0974f4f36472d807 /examples | |
parent | 5a98760f7954b9ad612fe2ae2a47887bffb26613 (diff) | |
download | qtlocation-13d2a4e31dbef2b48ebc44978368539ba96fded8.tar.gz |
MapView: add bearing / tilt wheel functionality; also with Magic Mouse
In Qt 5, Map had bearing / tilt mouse wheel functionality with keyboard
modifiers; that feature is now restored. We allow the wheel to zoom, to
change the bearing if the Shift key is held, or to change the tilt if
the Control key is held.
This is redundant when you're using a touchpad that can provide the
pinch-zoom feature; but we need it with the Magic Mouse on macOS,
because the cocoa plugin can't distinguish it from a trackpad, even
though it can't provide the pinch gesture. So we enable these features
for both mouse and touchpad devices on macOS.
Also allow mouse and touchpad with the minimal_map example.
There's a similar issue on Wayland, but let's try to fix the Wayland
plugin to distinguish these devices properly.
Pick-to: 6.5
Task-number: QTBUG-87646
Task-number: QTBUG-112394
Change-Id: I9e516a52e941b0b05cd0114afafde2767d80f4ff
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/location/minimal_map/main.qml | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/examples/location/minimal_map/main.qml b/examples/location/minimal_map/main.qml index d536943e..7093ceb6 100644 --- a/examples/location/minimal_map/main.qml +++ b/examples/location/minimal_map/main.qml @@ -43,6 +43,11 @@ Window { } WheelHandler { id: wheel + // workaround for QTBUG-87646 / QTBUG-112394: + // Magic Mouse pretends to be a trackpad but doesn't work with PinchHandler + acceptedDevices: Qt.platform.pluginName === "cocoa" + ? PointerDevice.Mouse | PointerDevice.TouchPad + : PointerDevice.Mouse rotationScale: 1/120 property: "zoomLevel" } |