Home · All Classes · Modules |
The QGesture class represents a gesture, containing properties that describe the corresponding user input. More...
Inherits QObject.
Inherited by QPanGesture, QPinchGesture, QSwipeGesture, QTapAndHoldGesture and QTapGesture.
The QGesture class represents a gesture, containing properties that describe the corresponding user input.
Gesture objects are not constructed directly by developers. They are created by the QGestureRecognizer object that is registered with the application; see QGestureRecognizer.registerRecognizer().
For an overview of gesture handling in Qt and information on using gestures in your applications, see the Gestures Programming document.
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 QGesture object, or by subclassing the QGesture class (or one of its subclasses).
A QGesture instance 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 QGestureEvent if 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.
This enum describes how accepting a gesture can cancel other gestures automatically.
Constant | Value | Description |
---|---|---|
QGesture.CancelNone | 0 | On accepting this gesture no other gestures will be affected. |
QGesture.CancelAllInContext | 1 | On accepting this gesture all gestures that are active in the context (respecting the Qt.GestureFlag that were specified when subscribed to the gesture) will be cancelled. |
The parent argument, if not None, causes self to be owned by Qt instead of PyQt.
Constructs a new gesture object with the given parent.
QGesture objects are created by gesture recognizers in the QGestureRecognizer.create() function.
PyQt 4.12.1 for X11 | Copyright © Riverbank Computing Ltd and The Qt Company 2015 | Qt 4.8.7 |