aboutsummaryrefslogtreecommitdiffstats
path: root/tests/manual/pointer
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2022-10-10 16:06:21 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2022-10-11 06:03:57 +0200
commitd11460f6b3a92a262cc165d5219b52b0018db8b9 (patch)
tree2de4e1613c48e08eb40a3ca234afb48738545bbc /tests/manual/pointer
parentee84a9e42b6f2d120be961040130277243680a9c (diff)
Pointer Handlers manual test: nested DragHandlers
This is one way of verifying that grabPermissions have the desired effect when one DragHandler needs to steal another's exclusive grab. Change-Id: I6aba3c7fe8dfaa5bfb3e6c0ccb36736829b47c37 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'tests/manual/pointer')
-rw-r--r--tests/manual/pointer/pointerDrag.qml50
1 files changed, 50 insertions, 0 deletions
diff --git a/tests/manual/pointer/pointerDrag.qml b/tests/manual/pointer/pointerDrag.qml
index adc9700907..0d603c71d0 100644
--- a/tests/manual/pointer/pointerDrag.qml
+++ b/tests/manual/pointer/pointerDrag.qml
@@ -240,5 +240,55 @@ Rectangle {
}
}
}
+
+ TextBox {
+ objectName: "dragSquircle9"
+ x: 200; y: 100
+ width: 100; height: 100
+ label: "DragHandler"
+ color: queryColor(drag9.active)
+ CheckBox {
+ id: ckGreedyDrag9
+ x: 10
+ y: 20
+ label: " Greedy"
+ checked: true
+ }
+ CheckBox {
+ id: ckZeroDragThreshold9
+ label: " Zero threshold"
+ x: 10
+ anchors.bottom: ckGreedyDragR9.top
+ checked: false
+ }
+ CheckBox {
+ id: ckGreedyDragR9
+ x: 10
+ anchors.bottom: dragRect9.top
+ label: " Greedy ↓"
+ checked: false
+ }
+ DragHandler {
+ id: drag9
+ objectName: "drag9"
+ grabPermissions: ckGreedyDrag9.checked ? DragHandler.CanTakeOverFromAnything :
+ DragHandler.CanTakeOverFromItems | DragHandler.CanTakeOverFromHandlersOfDifferentType | DragHandler.ApprovesTakeOverByAnything
+ dragThreshold: ckZeroDragThreshold9.checked ? 0 : undefined
+ }
+
+ TextBox {
+ id: dragRect9
+ objectName: "dragRect9"
+ label: "DragHandler"
+ x: (parent.width - width)/2
+ y: 65
+ DragHandler {
+ objectName: "dragRect9"
+ grabPermissions: ckGreedyDragR9.checked ? DragHandler.CanTakeOverFromAnything :
+ DragHandler.CanTakeOverFromItems | DragHandler.CanTakeOverFromHandlersOfDifferentType | DragHandler.ApprovesTakeOverByAnything
+ dragThreshold: ckZeroDragThreshold9.checked ? 0 : undefined
+ }
+ }
+ }
}
}