The GestureArea item enables simple gesture handling. 更多...
| 继承: | Item |
A GestureArea is like a MouseArea , but it has signals for gesture events.
警告: Elements in the Qt.labs module are not guaranteed to remain compatible in future versions.
警告: GestureArea is an experimental element whose development has been discontinued. PinchArea is available in QtQuick 1.1 and handles two finger gesture input.
注意: 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.
| 信号 | 类型 | 特性 | 描述 |
|---|---|---|---|
| onTap | point | 位置 | the position of the tap |
| onTapAndHold | point | 位置 | 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.
另请参阅 MouseArea .