aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/doc/snippets/pointerHandlers/pointHandlerAcceptedModifiers.qml
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2023-03-01 11:53:19 +0100
committerShawn Rutledge <shawn.rutledge@qt.io>2023-03-15 08:09:04 +0000
commita958aaa89ae44cd42433c34e51b602711d4ecabd (patch)
treed5611c71dbcb0086dd6d86f6e350102d487be39d /src/quick/doc/snippets/pointerHandlers/pointHandlerAcceptedModifiers.qml
parent39b63b688c4c6ab9898254bf1df1d5684febcc9c (diff)
doc: Customize and update docs for PointHandler
Many of the inherited docs were inappropriate or insufficiently specific to PointHandler. Now we have more snippets with more ideas for how it can be used. As a drive-by, fix a typo in the docs for PointerDeviceHandler::acceptedPointerTypes and add a link to the new PointerDevice page added in e283c05af745210d4a1f6c0aa9c33bf4da23a1e0 Fixes: QTBUG-74020 Fixes: QTBUG-106878 Change-Id: I028e1577ac5d4ef0b927c94259d6ab25b6028885 Reviewed-by: Doris Verria <doris.verria@qt.io> (cherry picked from commit 4c6d0b2bf09329dd8b036761f8f2924f54af3a07) Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/quick/doc/snippets/pointerHandlers/pointHandlerAcceptedModifiers.qml')
-rw-r--r--src/quick/doc/snippets/pointerHandlers/pointHandlerAcceptedModifiers.qml36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/quick/doc/snippets/pointerHandlers/pointHandlerAcceptedModifiers.qml b/src/quick/doc/snippets/pointerHandlers/pointHandlerAcceptedModifiers.qml
new file mode 100644
index 0000000000..9e3cb6f465
--- /dev/null
+++ b/src/quick/doc/snippets/pointerHandlers/pointHandlerAcceptedModifiers.qml
@@ -0,0 +1,36 @@
+// Copyright (C) 2023 Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+//![0]
+import QtQuick
+
+Item {
+ id: feedbackPane
+ width: 480; height: 320
+
+ PointHandler {
+ id: control
+ acceptedModifiers: Qt.ControlModifier
+ cursorShape: Qt.PointingHandCursor
+ target: Rectangle {
+ parent: feedbackPane
+ color: control.active ? "indianred" : "khaki"
+ x: control.point.position.x - width / 2
+ y: control.point.position.y - height / 2
+ width: 20; height: width; radius: width / 2
+ }
+ }
+
+ PointHandler {
+ id: shift
+ acceptedModifiers: Qt.ShiftModifier | Qt.MetaModifier
+ cursorShape: Qt.CrossCursor
+ target: Rectangle {
+ parent: feedbackPane
+ color: shift.active ? "darkslateblue" : "lightseagreen"
+ x: shift.point.position.x - width / 2
+ y: shift.point.position.y - height / 2
+ width: 30; height: width; radius: width / 2
+ }
+ }
+}
+//![0]