Extends Gesture

Gesture.LongPress

A discrete gesture recognizer for single or multi-finger long-presses.

Item {
    with Gesture.LongPress {
        touchesRequired: 2

        on longPressed {
            System.log("A two-finger long press!")
        }
    }
}

property Bool isLongPressedread only

event longPressed()

The longPresed() event is emitted when the long press is first recognized. The isLongPressed property will remain true for as long as the long press is still being held and recognized.

property Bool isPressedread only

The isPressed property will be true when the gesture is being pressed and either is still eligible to become a long press, or already is a long press.

This property is useful for giving visual feedback that an active area has been touched before the full long press is registered. In the case of multi-tap or multi-touch long press gestures, isPressed will become true for the first touch of each tap.

property Float touchXread only

property Float touchYread only

property Int touchesRequired: 1

The number of figers that must be pressed for the gesture to be recognized.

For example, to register a two-finger long press set touchesRequired to 2.

property Int minimumPressDuration: 500

The time, in milliseconds, that the use must press to trigger the gesture.

property Int tapsRequired: 0

The number of taps required before the long-press.

For example, if tapsRequired is 1, the user will have to touch, release and then touch-and-hold their finger to trigger the gesture.

By default, tapsRequired is 0, which means that no preceding taps are required to recognize the gesture.