继承者: QPanGesture , QPinchGesture , QSwipeGesture , QTapAndHoldGesture , QTapGesture
4.6 版新增。
def
gestureCancelPolicy
()
def
gestureType
()
def
hasHotSpot
()
def
hotSpot
()
def
setGestureCancelPolicy
(policy)
def
setHotSpot
(value)
def
state
()
def
unsetHotSpot
()
Gesture objects are not constructed directly by developers. They are created by the
QGestureRecognizerobject that is registered with the application; seeregisterRecognizer().For an overview of gesture handling in Qt and information on using gestures in your applications, see the 在 Widget 和图形视图中的手势 文档。
The class has a list of properties that can be queried by the user to get some gesture-specific arguments. For example, the pinch gesture has a scale factor that is exposed as a property.
Developers of custom gesture recognizers can add additional properties in order to provide additional information about a gesture. This can be done by adding new dynamic properties to a
QGestureobject, or by subclassing theQGestureclass (or one of its subclasses).
A
QGestureinstance is implicitly created when needed and is owned by Qt. Developers should never destroy them or store them for later use as Qt may destroy particular instances of them and create new ones to replace them.The registered gesture recognizer monitors the input events for the target object via its
recognize()function, updating the properties of the gesture object as required.The gesture object may be delivered to the target object in a
QGestureEventif the corresponding gesture is active or has just been canceled. Each event that is delivered contains a list of gesture objects, since support for more than one gesture may be enabled for the target object. Due to the way events are handled in Qt, gesture events may be filtered by other objects.
QGesture
(
[
parent=None
]
)
¶
- param parent
QObject
构造新的手势对象采用给定
parent
.
QGesture
objects are created by gesture recognizers in the
create()
函数。
PySide2.QtWidgets.QGesture.
GestureCancelPolicy
¶
This enum describes how accepting a gesture can cancel other gestures automatically.
|
常量 |
描述 |
|---|---|
|
QGesture.CancelNone |
On accepting this gesture no other gestures will be affected. |
|
QGesture.CancelAllInContext |
On accepting this gesture all gestures that are active in the context (respecting the
|
PySide2.QtWidgets.QGesture.
gestureCancelPolicy
(
)
¶
PySide2.QtWidgets.QGesture.
gestureType
(
)
¶
GestureType
PySide2.QtWidgets.QGesture.
hasHotSpot
(
)
¶
bool
PySide2.QtWidgets.QGesture.
hotSpot
(
)
¶
QPointF
另请参阅
PySide2.QtWidgets.QGesture.
setGestureCancelPolicy
(
policy
)
¶
policy
–
GestureCancelPolicy
PySide2.QtWidgets.QGesture.
state
(
)
¶
GestureState
PySide2.QtWidgets.QGesture.
unsetHotSpot
(
)
¶