Qt Reference Documentation

Contents

QML PinchArea Element

The PinchArea item enables simple pinch gesture handling. More...

Inherits Item

Properties

Signal Handlers

Detailed Description

The PinchArea element was added in QtQuick 1.1

A PinchArea is an invisible item that is typically used in conjunction with a visible item in order to provide pinch gesture handling for that item.

The enabled property is used to enable and disable pinch handling for the proxied item. When disabled, the pinch area becomes transparent to mouse/touch events.

PinchArea can be used in two ways:

See also PinchEvent.

Property Documentation

enabled : bool

This property holds whether the item accepts pinch gestures.

This property defaults to true.


pinch.target : Item

pinch.active : bool

pinch.minimumScale : real

pinch.maximumScale : real

pinch.minimumRotation : real

pinch.maximumRotation : real

pinch.dragAxis : enumeration

pinch.minimumX : real

pinch.maximumX : real

pinch.minimumY : real

pinch.maximumY : real

pinch provides a convenient way to make an item react to pinch gestures.

  • pinch.target specifies the id of the item to drag.
  • pinch.active specifies if the target item is currently being dragged.
  • pinch.minimumScale and pinch.maximumScale limit the range of the Item::scale property.
  • pinch.minimumRotation and pinch.maximumRotation limit the range of the Item::rotation property.
  • pinch.dragAxis specifies whether dragging in not allowed (Pinch.NoDrag), can be done horizontally (Pinch.XAxis), vertically (Pinch.YAxis), or both (Pinch.XandYAxis)
  • pinch.minimum and pinch.maximum limit how far the target can be dragged along the corresponding axes.

Signal Handler Documentation

PinchArea::onPinchFinished ()

This handler is called when the pinch area detects that a pinch gesture has finished.

The pinch parameter provides information about the pinch gesture, including the scale, center and angle of the pinch.


PinchArea::onPinchStarted ()

This handler is called when the pinch area detects that a pinch gesture has started.

The pinch parameter provides information about the pinch gesture, including the scale, center and angle of the pinch.

To ignore this gesture set the pinch.accepted property to false. The gesture will be cancelled and no further events will be sent.


PinchArea::onPinchUpdated ()

This handler is called when the pinch area detects that a pinch gesture has changed.

The pinch parameter provides information about the pinch gesture, including the scale, center and angle of the pinch.