diff options
Diffstat (limited to 'src/quick/doc/snippets/pointerHandlers/pinchHandlerAxisValueDeltas.qml')
-rw-r--r-- | src/quick/doc/snippets/pointerHandlers/pinchHandlerAxisValueDeltas.qml | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/quick/doc/snippets/pointerHandlers/pinchHandlerAxisValueDeltas.qml b/src/quick/doc/snippets/pointerHandlers/pinchHandlerAxisValueDeltas.qml new file mode 100644 index 0000000000..24d20537a3 --- /dev/null +++ b/src/quick/doc/snippets/pointerHandlers/pinchHandlerAxisValueDeltas.qml @@ -0,0 +1,29 @@ +// Copyright (C) 2022 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause +//![0] +import QtQuick + +Rectangle { + width: 100; height: 100 + color: "lightsteelblue"; antialiasing: true + + PinchHandler { + id: handler + target: null + xAxis.onActiveValueChanged: (delta) => parent.radius -= delta + yAxis.onActiveValueChanged: (delta) => parent.border.width += delta + rotationAxis.onActiveValueChanged: (delta) => parent.rotation += delta // add + scaleAxis.onActiveValueChanged: (delta) => parent.scale *= delta // multiply + } + + WheelHandler { + acceptedModifiers: Qt.NoModifier + property: "rotation" + } + + WheelHandler { + acceptedModifiers: Qt.ControlModifier + property: "scale" + } +} +//![0] |