#[repr(C)]pub struct QGestureRecognizer { /* private fields */ }
Expand description
The QGestureRecognizer class provides the infrastructure for gesture recognition.
C++ class: QGestureRecognizer
.
The QGestureRecognizer class provides the infrastructure for gesture recognition.
Gesture recognizers are responsible for creating and managing QGesture objects and monitoring input events sent to QWidget and QGraphicsObject subclasses. QGestureRecognizer is the base class for implementing custom gestures.
Developers that only need to provide gesture recognition for standard gestures do not need to use this class directly. Instances will be created behind the scenes by the framework.
For an overview of gesture handling in Qt and information on using gestures in your applications, see the Gestures in Widgets and Graphics View document.
Implementations§
Source§impl QGestureRecognizer
impl QGestureRecognizer
Sourcepub unsafe fn copy_from(
&self,
other: impl CastInto<Ref<QGestureRecognizer>>,
) -> Ref<QGestureRecognizer>
pub unsafe fn copy_from( &self, other: impl CastInto<Ref<QGestureRecognizer>>, ) -> Ref<QGestureRecognizer>
The QGestureRecognizer class provides the infrastructure for gesture recognition.
Calls C++ function: QGestureRecognizer& QGestureRecognizer::operator=(const QGestureRecognizer& other)
.
The QGestureRecognizer class provides the infrastructure for gesture recognition.
Gesture recognizers are responsible for creating and managing QGesture objects and monitoring input events sent to QWidget and QGraphicsObject subclasses. QGestureRecognizer is the base class for implementing custom gestures.
Developers that only need to provide gesture recognition for standard gestures do not need to use this class directly. Instances will be created behind the scenes by the framework.
For an overview of gesture handling in Qt and information on using gestures in your applications, see the Gestures in Widgets and Graphics View document.
Sourcepub unsafe fn create(
&self,
target: impl CastInto<Ptr<QObject>>,
) -> QPtr<QGesture>
pub unsafe fn create( &self, target: impl CastInto<Ptr<QObject>>, ) -> QPtr<QGesture>
This function is called by Qt to create a new QGesture object for the given target (QWidget or QGraphicsObject).
Calls C++ function: virtual QGesture* QGestureRecognizer::create(QObject* target)
.
This function is called by Qt to create a new QGesture object for the given target (QWidget or QGraphicsObject).
Reimplement this function to create a custom QGesture-derived gesture object if necessary.
The application takes ownership of the created gesture object.
Sourcepub unsafe fn recognize(
&self,
state: impl CastInto<Ptr<QGesture>>,
watched: impl CastInto<Ptr<QObject>>,
event: impl CastInto<Ptr<QEvent>>,
) -> QFlags<ResultFlag>
pub unsafe fn recognize( &self, state: impl CastInto<Ptr<QGesture>>, watched: impl CastInto<Ptr<QObject>>, event: impl CastInto<Ptr<QEvent>>, ) -> QFlags<ResultFlag>
Handles the given event for the watched object, updating the state of the gesture object as required, and returns a suitable result for the current recognition step.
Calls C++ function: pure virtual QFlags<QGestureRecognizer::ResultFlag> QGestureRecognizer::recognize(QGesture* state, QObject* watched, QEvent* event)
.
Handles the given event for the watched object, updating the state of the gesture object as required, and returns a suitable result for the current recognition step.
This function is called by the framework to allow the recognizer to filter input events dispatched to QWidget or QGraphicsObject instances that it is monitoring.
The result reflects how much of the gesture has been recognized. The state of the gesture object is set depending on the result.
See also QGestureRecognizer::Result.
Sourcepub unsafe fn register_recognizer(
recognizer: impl CastInto<Ptr<QGestureRecognizer>>,
) -> GestureType
pub unsafe fn register_recognizer( recognizer: impl CastInto<Ptr<QGestureRecognizer>>, ) -> GestureType
Registers the given recognizer in the gesture framework and returns a gesture ID for it.
Calls C++ function: static Qt::GestureType QGestureRecognizer::registerRecognizer(QGestureRecognizer* recognizer)
.
Registers the given recognizer in the gesture framework and returns a gesture ID for it.
The application takes ownership of the recognizer and returns the gesture type ID associated with it. For gesture recognizers which handle custom QGesture objects (i.e., those which return Qt::CustomGesture in a QGesture::gestureType() function) the return value is a generated gesture ID with the Qt::CustomGesture flag set.
See also unregisterRecognizer(), QGestureRecognizer::create(), and QGesture.
Sourcepub unsafe fn reset(&self, state: impl CastInto<Ptr<QGesture>>)
pub unsafe fn reset(&self, state: impl CastInto<Ptr<QGesture>>)
This function is called by the framework to reset a given gesture.
Calls C++ function: virtual void QGestureRecognizer::reset(QGesture* state)
.
Sourcepub unsafe fn unregister_recognizer(type_: GestureType)
pub unsafe fn unregister_recognizer(type_: GestureType)
Unregisters all gesture recognizers of the specified type.
Calls C++ function: static void QGestureRecognizer::unregisterRecognizer(Qt::GestureType type)
.
Unregisters all gesture recognizers of the specified type.
See also registerRecognizer().