1// Copyright (C) 2016 Jeremy Katz
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
5 \qmltype TouchEventSequence
8 \brief TouchEventSequence is used to build and dispatch touch events
13 A TouchEventSequence is created by calling \l [QML] {TestCase::touchEvent()}{TestCase.touchEvent()}.
14 The type can not be directly instantiated. Each method provided by the type returns
15 the same object, allowing chained calls.
19 touchEvent(item).press(0).commit();
23 var sequence = touchEvent(item);
28 Events are delivered to the window which contains the item specified in touchEvent.
30 \sa TestCase::touchEvent()
34 \qmlmethod TouchEventSequence TouchEventSequence::press(int touchId, object item, real x = item.width / 2, real y = item.height / 2)
36 Creates a new point identified as \a touchId, at the point indicated by \a x and \a y relative to \a item.
37 Further use of the same touch point should maintain the same touchId.
39 Item defaults to the value provided via touchEvent().
40 X and y default to the midpoint of the item.
44 \qmlmethod TouchEventSequence TouchEventSequence::move(int touchId, object item, real x = item.width / 2, real y = item.height / 2)
46 Moves \a touchId to the point indicated by \a x and \a y relative to \a item.
48 Item defaults to the value provided via touchEvent().
49 X and y default to the midpoint of the item.
53 \qmlmethod TouchEventSequence TouchEventSequence::release(int touchId, object item, real x = item.width / 2, real y = item.height / 2)
55 Removes \a touchId at the point indicated by \a x and \a y relative to \a item.
57 Item defaults to the value provided via touchEvent().
58 X and y default to the midpoint of the item.
62 \qmlmethod TouchEventSequence TouchEventSequence::stationary(int touchId)
64 Indicates that \a touchId is present but otherwise unchanged from prior events.
68 \qmlmethod TouchEventSequence TouchEventSequence::commit()
70 Sends the touch event composed by prior use of press(), move(), release(), and stationary().
71 Following commit's return, the TouchEventSequence can be used to compose a new event.
74 var sequence = touchEvent(target);
75 // Touch the middle of target with 1 point
80 // Move the point to target's upper left corner
81 sequence.move(1, target, 0, 0);
85 Commit is automatically invoked when the TouchEventSequence object is destroyed.