Struct QGraphicsSceneMoveEvent

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

The QGraphicsSceneMoveEvent class provides events for widget moving in the graphics view framework.

C++ class: QGraphicsSceneMoveEvent.

C++ documentation:

The QGraphicsSceneMoveEvent class provides events for widget moving in the graphics view framework.

A QGraphicsWidget sends itself a QGraphicsSceneMoveEvent immediately when its local position changes. The delivery is implemented as part of QGraphicsItem::itemChange().

It's similar to QMoveEvent, but its positions, oldPos() and newPos(), use QPointF instead of QPoint.

Implementations§

Source§

impl QGraphicsSceneMoveEvent

Source

pub unsafe fn new() -> CppBox<QGraphicsSceneMoveEvent>

Constructs a QGraphicsSceneMoveEvent.

Calls C++ function: [constructor] void QGraphicsSceneMoveEvent::QGraphicsSceneMoveEvent().

C++ documentation:

Source

pub unsafe fn new_pos(&self) -> CppBox<QPointF>

Returns the new position (i.e., the current position).

Calls C++ function: QPointF QGraphicsSceneMoveEvent::newPos() const.

C++ documentation:

Returns the new position (i.e., the current position).

See also oldPos() and QGraphicsItem::setPos().

Source

pub unsafe fn old_pos(&self) -> CppBox<QPointF>

Returns the old position (i.e., the position immediately before the widget was moved).

Calls C++ function: QPointF QGraphicsSceneMoveEvent::oldPos() const.

C++ documentation:

Returns the old position (i.e., the position immediately before the widget was moved).

See also newPos() and QGraphicsItem::setPos().

Source

pub unsafe fn set_new_pos(&self, pos: impl CastInto<Ref<QPointF>>)

Calls C++ function: void QGraphicsSceneMoveEvent::setNewPos(const QPointF& pos).

Source

pub unsafe fn set_old_pos(&self, pos: impl CastInto<Ref<QPointF>>)

Calls C++ function: void QGraphicsSceneMoveEvent::setOldPos(const QPointF& pos).

Methods from Deref<Target = QGraphicsSceneEvent>§

Source

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

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

Source

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

Returns the widget where the event originated, or 0 if the event originates from another application.

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

C++ documentation:

Returns the widget where the event originated, or 0 if the event originates from another application.

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 QGraphicsSceneMoveEvent

Source§

unsafe fn delete(&self)

Destroys the QGraphicsSceneMoveEvent.

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

C++ documentation:

Source§

impl Deref for QGraphicsSceneMoveEvent

Source§

fn deref(&self) -> &QGraphicsSceneEvent

Calls C++ function: QGraphicsSceneEvent* static_cast<QGraphicsSceneEvent*>(QGraphicsSceneMoveEvent* ptr).

Source§

type Target = QGraphicsSceneEvent

The resulting type after dereferencing.
Source§

impl DynamicCast<QGraphicsSceneMoveEvent> for QEvent

Source§

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

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

Source§

impl DynamicCast<QGraphicsSceneMoveEvent> for QGraphicsSceneEvent

Source§

unsafe fn dynamic_cast( ptr: Ptr<QGraphicsSceneEvent>, ) -> Ptr<QGraphicsSceneMoveEvent>

Calls C++ function: QGraphicsSceneMoveEvent* dynamic_cast<QGraphicsSceneMoveEvent*>(QGraphicsSceneEvent* ptr).

Source§

impl StaticDowncast<QGraphicsSceneMoveEvent> for QEvent

Source§

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

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

Source§

impl StaticDowncast<QGraphicsSceneMoveEvent> for QGraphicsSceneEvent

Source§

unsafe fn static_downcast( ptr: Ptr<QGraphicsSceneEvent>, ) -> Ptr<QGraphicsSceneMoveEvent>

Calls C++ function: QGraphicsSceneMoveEvent* static_cast<QGraphicsSceneMoveEvent*>(QGraphicsSceneEvent* ptr).

Source§

impl StaticUpcast<QEvent> for QGraphicsSceneMoveEvent

Source§

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

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

Source§

impl StaticUpcast<QGraphicsSceneEvent> for QGraphicsSceneMoveEvent

Source§

unsafe fn static_upcast( ptr: Ptr<QGraphicsSceneMoveEvent>, ) -> Ptr<QGraphicsSceneEvent>

Calls C++ function: QGraphicsSceneEvent* static_cast<QGraphicsSceneEvent*>(QGraphicsSceneMoveEvent* 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.