Struct QGestureEvent

Source
#[repr(C)]
pub struct QGestureEvent { /* private fields */ }
Expand description

The QGestureEvent class provides the description of triggered gestures.

C++ class: QGestureEvent.

C++ documentation:

The QGestureEvent class provides the description of triggered gestures.

The QGestureEvent class contains a list of gestures, which can be obtained using the gestures() function.

The gestures are either active or canceled. A list of those that are currently being executed can be obtained using the activeGestures() function. A list of those which were previously active and have been canceled can be accessed using the canceledGestures() function. A gesture might be canceled if the current window loses focus, for example, or because of a timeout, or for other reasons.

If the event handler does not accept the event by calling the generic QEvent::accept() function, all individual QGesture object that were not accepted and in the Qt::GestureStarted state will be propagated up the parent widget chain until a widget accepts them individually, by calling QGestureEvent::accept() for each of them, or an event filter consumes the event.

Implementations§

Source§

impl QGestureEvent

Source

pub unsafe fn accept_q_gesture(&self, arg1: impl CastInto<Ptr<QGesture>>)

Sets the accept flag of the given gesture object, the equivalent of calling setAccepted(gesture, true).

Calls C++ function: void QGestureEvent::accept(QGesture* arg1).

C++ documentation:

Sets the accept flag of the given gesture object, the equivalent of calling setAccepted(gesture, true).

Setting the accept flag indicates that the event receiver wants the gesture. Unwanted gestures may be propagated to the parent widget.

See also QGestureEvent::ignore().

Source

pub unsafe fn accept_gesture_type(&self, arg1: GestureType)

Sets the accept flag of the given gestureType, the equivalent of calling setAccepted(gestureType, true).

Calls C++ function: void QGestureEvent::accept(Qt::GestureType arg1).

C++ documentation:

Sets the accept flag of the given gestureType, the equivalent of calling setAccepted(gestureType, true).

Setting the accept flag indicates that the event receiver wants the gesture. Unwanted gestures may be propagated to the parent widget.

See also QGestureEvent::ignore().

Source

pub unsafe fn active_gestures(&self) -> CppBox<QListOfQGesture>

Returns a list of active (not canceled) gestures.

Calls C++ function: QList<QGesture*> QGestureEvent::activeGestures() const.

C++ documentation:

Returns a list of active (not canceled) gestures.

Source

pub unsafe fn canceled_gestures(&self) -> CppBox<QListOfQGesture>

Returns a list of canceled gestures.

Calls C++ function: QList<QGesture*> QGestureEvent::canceledGestures() const.

C++ documentation:

Returns a list of canceled gestures.

Source

pub unsafe fn copy_from( &self, other: impl CastInto<Ref<QGestureEvent>>, ) -> Ref<QGestureEvent>

The QGestureEvent class provides the description of triggered gestures.

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

C++ documentation:

The QGestureEvent class provides the description of triggered gestures.

The QGestureEvent class contains a list of gestures, which can be obtained using the gestures() function.

The gestures are either active or canceled. A list of those that are currently being executed can be obtained using the activeGestures() function. A list of those which were previously active and have been canceled can be accessed using the canceledGestures() function. A gesture might be canceled if the current window loses focus, for example, or because of a timeout, or for other reasons.

If the event handler does not accept the event by calling the generic QEvent::accept() function, all individual QGesture object that were not accepted and in the Qt::GestureStarted state will be propagated up the parent widget chain until a widget accepts them individually, by calling QGestureEvent::accept() for each of them, or an event filter consumes the event.

Source

pub unsafe fn gesture(&self, type_: GestureType) -> QPtr<QGesture>

Returns a gesture object by type.

Calls C++ function: QGesture* QGestureEvent::gesture(Qt::GestureType type) const.

C++ documentation:

Returns a gesture object by type.

Source

pub unsafe fn gestures(&self) -> CppBox<QListOfQGesture>

Returns all gestures that are delivered in the event.

Calls C++ function: QList<QGesture*> QGestureEvent::gestures() const.

C++ documentation:

Returns all gestures that are delivered in the event.

Source

pub unsafe fn ignore_q_gesture(&self, arg1: impl CastInto<Ptr<QGesture>>)

Clears the accept flag parameter of the given gesture object, the equivalent of calling setAccepted(gesture, false).

Calls C++ function: void QGestureEvent::ignore(QGesture* arg1).

C++ documentation:

Clears the accept flag parameter of the given gesture object, the equivalent of calling setAccepted(gesture, false).

Clearing the accept flag indicates that the event receiver does not want the gesture. Unwanted gestures may be propagated to the parent widget.

See also QGestureEvent::accept().

Source

pub unsafe fn ignore_gesture_type(&self, arg1: GestureType)

Clears the accept flag parameter of the given gestureType, the equivalent of calling setAccepted(gesture, false).

Calls C++ function: void QGestureEvent::ignore(Qt::GestureType arg1).

C++ documentation:

Clears the accept flag parameter of the given gestureType, the equivalent of calling setAccepted(gesture, false).

Clearing the accept flag indicates that the event receiver does not want the gesture. Unwanted gestures may be propgated to the parent widget.

See also QGestureEvent::accept().

Source

pub unsafe fn is_accepted_q_gesture( &self, arg1: impl CastInto<Ptr<QGesture>>, ) -> bool

Returns true if the gesture is accepted; otherwise returns false.

Calls C++ function: bool QGestureEvent::isAccepted(QGesture* arg1) const.

C++ documentation:

Returns true if the gesture is accepted; otherwise returns false.

Source

pub unsafe fn is_accepted_gesture_type(&self, arg1: GestureType) -> bool

Returns true if the gesture of type gestureType is accepted; otherwise returns false.

Calls C++ function: bool QGestureEvent::isAccepted(Qt::GestureType arg1) const.

C++ documentation:

Returns true if the gesture of type gestureType is accepted; otherwise returns false.

Source

pub unsafe fn map_to_graphics_scene( &self, gesture_point: impl CastInto<Ref<QPointF>>, ) -> CppBox<QPointF>

Returns the scene-local coordinates if the gesturePoint is inside a graphics view.

Calls C++ function: QPointF QGestureEvent::mapToGraphicsScene(const QPointF& gesturePoint) const.

C++ documentation:

Returns the scene-local coordinates if the gesturePoint is inside a graphics view.

This functional might be useful when the gesture event is delivered to a QGraphicsObject to translate a point in screen coordinates to scene-local coordinates.

See also QPointF::isNull().

Source

pub unsafe fn new( gestures: impl CastInto<Ref<QListOfQGesture>>, ) -> CppBox<QGestureEvent>

Creates new QGestureEvent containing a list of gestures.

Calls C++ function: [constructor] void QGestureEvent::QGestureEvent(const QList<QGesture*>& gestures).

C++ documentation:

Creates new QGestureEvent containing a list of gestures.

Source

pub unsafe fn new_copy( other: impl CastInto<Ref<QGestureEvent>>, ) -> CppBox<QGestureEvent>

The QGestureEvent class provides the description of triggered gestures.

Calls C++ function: [constructor] void QGestureEvent::QGestureEvent(const QGestureEvent& other).

C++ documentation:

The QGestureEvent class provides the description of triggered gestures.

The QGestureEvent class contains a list of gestures, which can be obtained using the gestures() function.

The gestures are either active or canceled. A list of those that are currently being executed can be obtained using the activeGestures() function. A list of those which were previously active and have been canceled can be accessed using the canceledGestures() function. A gesture might be canceled if the current window loses focus, for example, or because of a timeout, or for other reasons.

If the event handler does not accept the event by calling the generic QEvent::accept() function, all individual QGesture object that were not accepted and in the Qt::GestureStarted state will be propagated up the parent widget chain until a widget accepts them individually, by calling QGestureEvent::accept() for each of them, or an event filter consumes the event.

Source

pub unsafe fn set_accepted_q_gesture_bool( &self, arg1: impl CastInto<Ptr<QGesture>>, arg2: bool, )

Sets the accept flag of the given gesture object to the specified value.

Calls C++ function: void QGestureEvent::setAccepted(QGesture* arg1, bool arg2).

C++ documentation:

Sets the accept flag of the given gesture object to the specified value.

Setting the accept flag indicates that the event receiver wants the gesture. Unwanted gestures may be propagated to the parent widget.

By default, gestures in events of type QEvent::Gesture are accepted, and gestures in QEvent::GestureOverride events are ignored.

For convenience, the accept flag can also be set with accept(gesture), and cleared with ignore(gesture).

See also isAccepted().

Source

pub unsafe fn set_accepted_gesture_type_bool( &self, arg1: GestureType, arg2: bool, )

Sets the accept flag of the given gestureType object to the specified value.

Calls C++ function: void QGestureEvent::setAccepted(Qt::GestureType arg1, bool arg2).

C++ documentation:

Sets the accept flag of the given gestureType object to the specified value.

Setting the accept flag indicates that the event receiver wants to receive gestures of the specified type, gestureType. Unwanted gestures may be propagated to the parent widget.

By default, gestures in events of type QEvent::Gesture are accepted, and gestures in QEvent::GestureOverride events are ignored.

For convenience, the accept flag can also be set with accept(gestureType), and cleared with ignore(gestureType).

Source

pub unsafe fn set_widget(&self, widget: impl CastInto<Ptr<QWidget>>)

Calls C++ function: void QGestureEvent::setWidget(QWidget* widget).

Source

pub unsafe fn widget(&self) -> QPtr<QWidget>

Returns the widget on which the event occurred.

Calls C++ function: QWidget* QGestureEvent::widget() const.

C++ documentation:

Returns the widget on which the event occurred.

Methods from Deref<Target = QEvent>§

Source

pub unsafe fn accept(&self)

Sets the accept flag of the event object, the equivalent of calling setAccepted(true).

Calls C++ function: void QEvent::accept().

C++ documentation:

Sets the accept flag of the event object, the equivalent of calling setAccepted(true).

Setting the accept parameter indicates that the event receiver wants the event. Unwanted events might be propagated to the parent widget.

See also ignore().

Source

pub unsafe fn copy_from(&self, other: impl CastInto<Ref<QEvent>>) -> Ref<QEvent>

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

Source

pub unsafe fn ignore(&self)

Clears the accept flag parameter of the event object, the equivalent of calling setAccepted(false).

Calls C++ function: void QEvent::ignore().

C++ documentation:

Clears the accept flag parameter of the event object, the equivalent of calling setAccepted(false).

Clearing the accept parameter indicates that the event receiver does not want the event. Unwanted events might be propagated to the parent widget.

See also accept().

Source

pub unsafe fn is_accepted(&self) -> bool

the accept flag of the event object

Calls C++ function: bool QEvent::isAccepted() const.

C++ documentation:

the accept flag of the event object

Setting the accept parameter indicates that the event receiver wants the event. Unwanted events might be propagated to the parent widget. By default, isAccepted() is set to true, but don't rely on this as subclasses may choose to clear it in their constructor.

For convenience, the accept flag can also be set with accept(), and cleared with ignore().

Access functions:

bool isAccepted() const
void setAccepted(bool accepted)
Source

pub unsafe fn set_accepted(&self, accepted: bool)

the accept flag of the event object

Calls C++ function: void QEvent::setAccepted(bool accepted).

C++ documentation:

the accept flag of the event object

Setting the accept parameter indicates that the event receiver wants the event. Unwanted events might be propagated to the parent widget. By default, isAccepted() is set to true, but don't rely on this as subclasses may choose to clear it in their constructor.

For convenience, the accept flag can also be set with accept(), and cleared with ignore().

Access functions:

bool isAccepted() const
void setAccepted(bool accepted)
Source

pub unsafe fn spontaneous(&self) -> bool

Returns true if the event originated outside the application (a system event); otherwise returns false.

Calls C++ function: bool QEvent::spontaneous() const.

C++ documentation:

Returns true if the event originated outside the application (a system event); otherwise returns false.

The return value of this function is not defined for paint events.

Source

pub unsafe fn type_(&self) -> Type

Returns the event type.

Calls C++ function: QEvent::Type QEvent::type() const.

C++ documentation:

Returns the event type.

Trait Implementations§

Source§

impl CppDeletable for QGestureEvent

Source§

unsafe fn delete(&self)

Destroys QGestureEvent.

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

C++ documentation:

Destroys QGestureEvent.

Source§

impl Deref for QGestureEvent

Source§

fn deref(&self) -> &QEvent

Calls C++ function: QEvent* static_cast<QEvent*>(QGestureEvent* ptr).

Source§

type Target = QEvent

The resulting type after dereferencing.
Source§

impl DynamicCast<QGestureEvent> for QEvent

Source§

unsafe fn dynamic_cast(ptr: Ptr<QEvent>) -> Ptr<QGestureEvent>

Calls C++ function: QGestureEvent* dynamic_cast<QGestureEvent*>(QEvent* ptr).

Source§

impl StaticDowncast<QGestureEvent> for QEvent

Source§

unsafe fn static_downcast(ptr: Ptr<QEvent>) -> Ptr<QGestureEvent>

Calls C++ function: QGestureEvent* static_cast<QGestureEvent*>(QEvent* ptr).

Source§

impl StaticUpcast<QEvent> for QGestureEvent

Source§

unsafe fn static_upcast(ptr: Ptr<QGestureEvent>) -> Ptr<QEvent>

Calls C++ function: QEvent* static_cast<QEvent*>(QGestureEvent* ptr).

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T, U> CastInto<U> for T
where U: CastFrom<T>,

Source§

unsafe fn cast_into(self) -> U

Performs the conversion. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> StaticUpcast<T> for T

Source§

unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>

Convert type of a const pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.