[−][src]Struct qt_widgets::QGestureRecognizer
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.
Methods
impl QGestureRecognizer
[src]
pub unsafe fn copy_from(
&mut self,
other: impl CastInto<Ref<QGestureRecognizer>>
) -> MutRef<QGestureRecognizer>
[src]
&mut self,
other: impl CastInto<Ref<QGestureRecognizer>>
) -> MutRef<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.
pub unsafe fn create(
&mut self,
target: impl CastInto<MutPtr<QObject>>
) -> MutPtr<QGesture>
[src]
&mut self,
target: impl CastInto<MutPtr<QObject>>
) -> MutPtr<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.
pub unsafe fn recognize(
&mut self,
state: impl CastInto<MutPtr<QGesture>>,
watched: impl CastInto<MutPtr<QObject>>,
event: impl CastInto<MutPtr<QEvent>>
) -> QFlags<ResultFlag>
[src]
&mut self,
state: impl CastInto<MutPtr<QGesture>>,
watched: impl CastInto<MutPtr<QObject>>,
event: impl CastInto<MutPtr<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.
pub unsafe fn register_recognizer(
recognizer: impl CastInto<MutPtr<QGestureRecognizer>>
) -> GestureType
[src]
recognizer: impl CastInto<MutPtr<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.
pub unsafe fn reset(&mut self, state: impl CastInto<MutPtr<QGesture>>)
[src]
This function is called by the framework to reset a given gesture.
Calls C++ function: virtual void QGestureRecognizer::reset(QGesture* state)
.
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)
.
Unregisters all gesture recognizers of the specified type.
See also registerRecognizer().
Trait Implementations
impl CppDeletable for QGestureRecognizer
[src]
Auto Trait Implementations
impl Send for QGestureRecognizer
impl Sync for QGestureRecognizer
impl Unpin for QGestureRecognizer
impl RefUnwindSafe for QGestureRecognizer
impl UnwindSafe for QGestureRecognizer
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> StaticUpcast<T> for T
[src]
unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>
[src]
unsafe fn static_upcast_mut(ptr: MutPtr<T>) -> MutPtr<T>
[src]
impl<T, U> CastInto<U> for T where
U: CastFrom<T>,
[src]
U: CastFrom<T>,