The GestureArea item enables simple gesture handling. More...
Inherits Item
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.
Signal | Type | Property | Description |
---|---|---|---|
onTap | point | position | the position of the tap |
onTapAndHold | point | position | the position of the tap |
onPan | real | acceleration | the acceleration of the pan |
onPan | point | delta | the offset from the previous input position to the current input |
onPan | point | offset | the total offset from the first input position to the current input position |
onPan | point | lastOffset | the previous value of offset |
onPinch | point | centerPoint | the midpoint between the two input points |
onPinch | point | lastCenterPoint | the previous value of centerPoint |
onPinch | point | startCenterPoint | the first value of centerPoint |
onPinch | real | rotationAngle | the angle covered by the gesture motion |
onPinch | real | lastRotationAngle | the previous value of rotationAngle |
onPinch | real | totalRotationAngle | the complete angle covered by the gesture |
onPinch | real | scaleFactor | the change in distance between the two input points |
onPinch | real | lastScaleFactor | the previous value of scaleFactor |
onPinch | real | totalScaleFactor | the complete scale factor of the gesture |
onSwipe | real | swipeAngle | the 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.
© 2008-2011 Nokia Corporation and/or its subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation in Finland and/or other countries worldwide.
All other trademarks are property of their respective owners. Privacy Policy
Licensees holding valid Qt Commercial licenses may use this document in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and Nokia.
Alternatively, this document may be used under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation.