Touch & gestures
veriCue synthesizes real Qt touch events - TouchBegin / TouchUpdate / TouchEnd sequences with correctly mapped local, scene, and global coordinates. Gestures work identically on QWidget and QML/Qt Quick targets: handlers build platform-neutral touch points and only the QPA boundary constructs the final Qt event, so the same test drives both UI stacks on Qt 5.15 and Qt 6.
All commands take a path to the target object. Coordinates are local to the target; when x/y are omitted, the target's center is used.
touch_tap
A single finger press-and-release.
| Param | Type | Default | Meaning |
|---|---|---|---|
path | string | - | Target object |
x, y | int | center | Tap position (local coords) |
duration | int | 50 | Hold time in ms between press and release |
await client.touch_tap("MainWindow/canvas")
await client.touch_tap("MainWindow/canvas", x=10, y=20, duration=100)await client.TouchTapAsync("MainWindow/canvas", durationMs: 100);touch_long_press
Same as touch_tap with a longer default hold - use it to trigger long-press context menus and press-and-hold interactions.
| Param | Type | Default |
|---|---|---|
path | string | - |
x, y | int | center |
duration | int | 800 |
await client.touch_long_press("MainWindow/listView", x=50, y=120)swipe
A one-finger drag from one point to another, interpolated over stepsTouchUpdate events spread across duration milliseconds.
| Param | Type | Default | Meaning |
|---|---|---|---|
path | string | - | Target object |
from_x, from_y | int | required | Start position |
to_x, to_y | int | required | End position |
duration | int | 300 | Total gesture time in ms |
steps | int | 10 | Number of interpolated move events |
# Scroll a list upward by swiping from bottom to top
await client.swipe("MainWindow/listView", 100, 400, 100, 50)
# Slow, fine-grained swipe for drag-sensitive widgets
await client.swipe("MainWindow/slider", 0, 20, 200, 20, duration=800, steps=40)await client.SwipeAsync("MainWindow/listView", 100, 400, 100, 50);Increase steps when the widget under test tracks velocity or reacts to intermediate positions (kinetic scrolling, drag thresholds).
pinch
A two-finger pinch/zoom, optionally with rotation. Two touch points start start_distance apart, centered on the target (or on center_x/center_y), and move to end_distance apart while rotating by rotation degrees.
| Param | Type | Default | Meaning |
|---|---|---|---|
path | string | - | Target object |
start_distance | int | required | Initial finger separation (px, must be > 0) |
end_distance | int | required | Final finger separation (px, must be > 0) |
center_x, center_y | int | target center | Gesture center |
rotation | double | 0.0 | Total rotation in degrees |
duration | int | 300 | Total gesture time in ms |
steps | int | 10 | Interpolated move events |
The response includes the effective scale (end_distance / start_distance).
# Zoom in 2x
await client.pinch("MainWindow/mapView", start_distance=100, end_distance=200)
# Zoom out while rotating 45°
await client.pinch("MainWindow/mapView", start_distance=200,
end_distance=100, rotation=45.0)await client.PinchAsync("MainWindow/mapView", startDistance: 100, endDistance: 200);multi_touch
Low-level access for arbitrary multi-finger interactions. You send one command per frame; each command carries the full set of active touch points.
| Param | Type | Meaning |
|---|---|---|
path | string | Target object |
touches | array | One object per finger: {id, x, y, action} |
action is one of press, move, release. The event type is derived from the combined actions: any press → TouchBegin, all release → TouchEnd, otherwise TouchUpdate. Keep id stable per finger across frames.
# Two-finger tap
await client.multi_touch("MainWindow/canvas", [
{"id": 0, "x": 100, "y": 100, "action": "press"},
{"id": 1, "x": 200, "y": 100, "action": "press"},
])
await client.multi_touch("MainWindow/canvas", [
{"id": 0, "x": 100, "y": 100, "action": "release"},
{"id": 1, "x": 200, "y": 100, "action": "release"},
])Errors
2001 object_not_found- the path did not resolve, or the target was destroyed mid-gesture. Timed gestures (swipe,pinch, taps with a hold) run the Qt event loop between steps; if the interaction closes the widget (e.g. a tap dismisses a dialog), the gesture aborts safely with this error instead of touching a dead object.2004 widget_not_visible/2005 widget_not_enabled- target failed visibility/enabled validation at resolve time.1004 invalid_params- missing required coordinates, non-positivesteps/distances, or a malformedtouchesarray.
QML notes
Touch events for Qt Quick items are delivered with scene coordinates to the owning QQuickWindow, matching how real touch input is dispatched - so MultiPointTouchArea, PinchArea, and Flickable behave exactly as they do under a finger.

