QML GestureArea Element

The GestureArea item enables simple gesture handling. More...

Inherits Item

Detailed Description

A GestureArea is like a MouseArea, but it has signals for gesture events.

Warning: Elements in the Qt.labs module are not guaranteed to remain compatible in future versions.

Warning: GestureArea is an experimental element whose development has been discontinued. PinchArea is available in QtQuick 1.1 and handles two finger gesture input.

Note: This element is only functional on devices with touch input.

 import Qt.labs.gestures 1.0

 GestureArea {
     anchors.fill: parent
  // onPan:        ... gesture.acceleration ...
  // onPinch:      ... gesture.rotationAngle ...
  // onSwipe:      ...
  // onTapAndHold: ...
  // onTap:        ...
  // onGesture:    ...
 }

Each signal has a gesture parameter that has the properties of the gesture.

SignalTypePropertyDescription
onTappointpositionthe position of the tap
onTapAndHoldpointpositionthe position of the tap
onPanrealaccelerationthe acceleration of the pan
onPanpointdeltathe offset from the previous input position to the current input
onPanpointoffsetthe total offset from the first input position to the current input position
onPanpointlastOffsetthe previous value of offset
onPinchpointcenterPointthe midpoint between the two input points
onPinchpointlastCenterPointthe previous value of centerPoint
onPinchpointstartCenterPointthe first value of centerPoint
onPinchrealrotationAnglethe angle covered by the gesture motion
onPinchreallastRotationAnglethe previous value of rotationAngle
onPinchrealtotalRotationAnglethe complete angle covered by the gesture
onPinchrealscaleFactorthe change in distance between the two input points
onPinchreallastScaleFactorthe previous value of scaleFactor
onPinchrealtotalScaleFactorthe complete scale factor of the gesture
onSwiperealswipeAnglethe angle of the swipe

Custom gestures, handled by onGesture, will have custom properties.

GestureArea is an invisible item: it is never painted.

See also MouseArea.

Notes provided by the Qt Community

No notes