[][src]Struct qt_widgets::QGestureRecognizer

#[repr(C)]pub struct QGestureRecognizer { /* fields omitted */ }

The QGestureRecognizer class provides the infrastructure for gesture recognition.

C++ class: QGestureRecognizer.

C++ documentation:

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.

Methods

impl QGestureRecognizer[src]

pub unsafe fn copy_from(
    &self,
    other: impl CastInto<Ref<QGestureRecognizer>>
) -> Ref<QGestureRecognizer>
[src]

The QGestureRecognizer class provides the infrastructure for gesture recognition.

Calls C++ function: QGestureRecognizer& QGestureRecognizer::operator=(const QGestureRecognizer& other).

C++ documentation:

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.

pub unsafe fn create(
    &self,
    target: impl CastInto<Ptr<QObject>>
) -> QPtr<QGesture>
[src]

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).

C++ documentation:

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.

pub unsafe fn recognize(
    &self,
    state: impl CastInto<Ptr<QGesture>>,
    watched: impl CastInto<Ptr<QObject>>,
    event: impl CastInto<Ptr<QEvent>>
) -> QFlags<ResultFlag>
[src]

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).

C++ documentation:

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.

pub unsafe fn register_recognizer(
    recognizer: impl CastInto<Ptr<QGestureRecognizer>>
) -> GestureType
[src]

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).

C++ documentation:

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.

pub unsafe fn reset(&self, state: impl CastInto<Ptr<QGesture>>)[src]

This function is called by the framework to reset a given gesture.

Calls C++ function: virtual void QGestureRecognizer::reset(QGesture* state).

C++ documentation:

This function is called by the framework to reset a given gesture.

Reimplement this function to implement additional requirements for custom QGesture objects. This may be necessary if you implement a custom QGesture whose properties need special handling when the gesture is reset.

pub unsafe fn unregister_recognizer(type_: GestureType)[src]

Unregisters all gesture recognizers of the specified type.

Calls C++ function: static void QGestureRecognizer::unregisterRecognizer(Qt::GestureType type).

C++ documentation:

Unregisters all gesture recognizers of the specified type.

See also registerRecognizer().

Trait Implementations

impl CppDeletable for QGestureRecognizer[src]

unsafe fn delete(&self)[src]

Destroys the gesture recognizer.

Calls C++ function: virtual [destructor] void QGestureRecognizer::~QGestureRecognizer().

C++ documentation:

Destroys the gesture recognizer.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> CastInto<U> for T where
    U: CastFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> StaticUpcast<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.