# TestExtras QML Type

Singleton type providing additional test functions. More...

Import Statement: | import Lomiri.Test 1.0

- List of all members, including inherited members

## Methods

- cpuArchitecture()
- void mouseDrag(touchId, item, from, delta, button, stateKey, steps, delay)
- openGLflavor()
- registerTouchDevice()
- touchClick(touchId, item, point)
- touchDevicePresent()
- touchDoubleClick(touchId, item, point)
- touchDrag(touchId, item, from, delta, steps)
- touchLongPress(touchId, item, point)
- touchMove(touchId, item, point)
- touchPress(touchId, item, point)
- touchRelease(touchId, item, point)

## Detailed Description

The component provides additional test functions like touch handling, registering touch device on non-touch screen enabled environment.

## Method Documentation

cpuArchitecture()

Returns the build architecure, including but not limited to "arm", "arm64", "i386" and "x86_64".

void mouseDrag(touchId, item, from, delta, button, stateKey, steps = 5, delay = 20)

The function performs a drag with a mouse over an item from the starting point from with a delta. The gesture is realized with a mouse press, step moves and a release event, with a delay in between each mouse event.

By default the function uses 5 steps to produce the drag. This value can be any positive number, driving the gesture appliance to be faster (less than 5 moves) or slower (more than 5 moves). If a negative or 0 value is given, the function will use the default 5 steps to produce the gesture.

openGLflavor()

Returns "opengl" or "opengles2".

registerTouchDevice()

Registers a touch device if there's none registered. Calling the function in touch enabled environment has no effect. The function must be called in initTestCase() in order to perform touch related tests.

touchClick(touchId, item, point)

The function performs a pair of touchPress and touchRelease calls on the same point resulting in a click like event.

touchDevicePresent()

Returns true if the system has a touch device registered.

touchDoubleClick(touchId, item, point)

The function performs two consecutive touchClick events with a slight delay in between each click event.

touchDrag(touchId, item, from, delta, steps = 5)

The function performs a drag gesture on a touch point identified by touchId over an item from the starting point from with a delta. The gesture is realized with a touch press, step moves and a release event.

By default the function uses 5 steps to produce the gesture. This value can be any positive number, driving the gesture appliance to be faster (less than 5 moves) or slower (more than 5 moves). If a negative or 0 value is given, the function will use the default 5 steps to produce the gesture.

touchLongPress(touchId, item, point)

The function produces a touchPress event with a timeout equivalent to the mouse `pressAndHold` timeout, after which the function returns.

touchMove(touchId, item, point)

The function moves the touch point identified by the touchId to the destination point. The point is in item coordinates. The touch point identified by the touchId must be pressed before calling this function in order to produce the desired functionality. The event can be captured in a `MultiPointTouchArea` through `updated()` signal.

touchPress(touchId, item, point)

The function triggers a touch press event for a given touchId on a specific item. The point contains the (x,y) coordinates of the event in item coordinates.

touchRelease(touchId, item, point)

The function produces a touch release event on a given touchId performed on item at a point.