mobile/debug: simulate zooming through mouse wheel on desktop

And allow touchpad gestures to be recognized as well. This has no
negative impact on the mobile platforms, but makes it much easier to
test profile scaling / panning on the desktop.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2020-03-24 15:30:44 -07:00
parent 93ab1232f0
commit f084852f5c

View file

@ -277,6 +277,16 @@ Item {
// pass events through to the parent and eventually into the ListView
propagateComposedEvents: true
// for testing / debugging on a desktop
scrollGestureEnabled: true
onWheel: {
manager.appendTextToLog("wheel " + wheel.angleDelta)
if (wheel.angleDelta.y > 0)
qmlProfile.scale += 0.2
if (wheel.angleDelta.y < 0 && qmlProfile.scale > 1.1)
qmlProfile.scale -= 0.2
}
anchors.fill: parent
drag.target: qmlProfile
drag.axis: Drag.XAndYAxis