#[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
.
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
impl QGraphicsSceneMoveEvent
Sourcepub unsafe fn new() -> CppBox<QGraphicsSceneMoveEvent>
pub unsafe fn new() -> CppBox<QGraphicsSceneMoveEvent>
Constructs a QGraphicsSceneMoveEvent.
Calls C++ function: [constructor] void QGraphicsSceneMoveEvent::QGraphicsSceneMoveEvent()
.
Constructs a QGraphicsSceneMoveEvent.
Sourcepub unsafe fn new_pos(&self) -> CppBox<QPointF>
pub unsafe fn new_pos(&self) -> CppBox<QPointF>
Returns the new position (i.e., the current position).
Calls C++ function: QPointF QGraphicsSceneMoveEvent::newPos() const
.
Returns the new position (i.e., the current position).
See also oldPos() and QGraphicsItem::setPos().
Sourcepub unsafe fn old_pos(&self) -> CppBox<QPointF>
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
.
Returns the old position (i.e., the position immediately before the widget was moved).
See also newPos() and QGraphicsItem::setPos().
Sourcepub unsafe fn set_new_pos(&self, pos: impl CastInto<Ref<QPointF>>)
pub unsafe fn set_new_pos(&self, pos: impl CastInto<Ref<QPointF>>)
Calls C++ function: void QGraphicsSceneMoveEvent::setNewPos(const QPointF& pos)
.
Sourcepub unsafe fn set_old_pos(&self, pos: impl CastInto<Ref<QPointF>>)
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>§
Sourcepub unsafe fn set_widget(&self, widget: impl CastInto<Ptr<QWidget>>)
pub unsafe fn set_widget(&self, widget: impl CastInto<Ptr<QWidget>>)
Calls C++ function: void QGraphicsSceneEvent::setWidget(QWidget* widget)
.
Sourcepub unsafe fn widget(&self) -> QPtr<QWidget>
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
.
Returns the widget where the event originated, or 0 if the event originates from another application.
Methods from Deref<Target = QEvent>§
Sourcepub unsafe fn accept(&self)
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()
.
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().
Sourcepub unsafe fn copy_from(&self, other: impl CastInto<Ref<QEvent>>) -> Ref<QEvent>
pub unsafe fn copy_from(&self, other: impl CastInto<Ref<QEvent>>) -> Ref<QEvent>
Calls C++ function: QEvent& QEvent::operator=(const QEvent& other)
.
Sourcepub unsafe fn ignore(&self)
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()
.
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().
Sourcepub unsafe fn is_accepted(&self) -> bool
pub unsafe fn is_accepted(&self) -> bool
the accept flag of the event object
Calls C++ function: bool QEvent::isAccepted() const
.
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) |
Sourcepub unsafe fn set_accepted(&self, accepted: bool)
pub unsafe fn set_accepted(&self, accepted: bool)
the accept flag of the event object
Calls C++ function: void QEvent::setAccepted(bool accepted)
.
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) |
Sourcepub unsafe fn spontaneous(&self) -> bool
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
.
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.
Trait Implementations§
Source§impl CppDeletable for QGraphicsSceneMoveEvent
impl CppDeletable for QGraphicsSceneMoveEvent
Source§unsafe fn delete(&self)
unsafe fn delete(&self)
Destroys the QGraphicsSceneMoveEvent.
Calls C++ function: virtual [destructor] void QGraphicsSceneMoveEvent::~QGraphicsSceneMoveEvent()
.
Destroys the QGraphicsSceneMoveEvent.
Source§impl Deref for QGraphicsSceneMoveEvent
impl Deref for QGraphicsSceneMoveEvent
Source§fn deref(&self) -> &QGraphicsSceneEvent
fn deref(&self) -> &QGraphicsSceneEvent
Calls C++ function: QGraphicsSceneEvent* static_cast<QGraphicsSceneEvent*>(QGraphicsSceneMoveEvent* ptr)
.
Source§type Target = QGraphicsSceneEvent
type Target = QGraphicsSceneEvent
Source§impl DynamicCast<QGraphicsSceneMoveEvent> for QEvent
impl DynamicCast<QGraphicsSceneMoveEvent> for QEvent
Source§unsafe fn dynamic_cast(ptr: Ptr<QEvent>) -> Ptr<QGraphicsSceneMoveEvent>
unsafe fn dynamic_cast(ptr: Ptr<QEvent>) -> Ptr<QGraphicsSceneMoveEvent>
Calls C++ function: QGraphicsSceneMoveEvent* dynamic_cast<QGraphicsSceneMoveEvent*>(QEvent* ptr)
.
Source§impl DynamicCast<QGraphicsSceneMoveEvent> for QGraphicsSceneEvent
impl DynamicCast<QGraphicsSceneMoveEvent> for QGraphicsSceneEvent
Source§unsafe fn dynamic_cast(
ptr: Ptr<QGraphicsSceneEvent>,
) -> Ptr<QGraphicsSceneMoveEvent>
unsafe fn dynamic_cast( ptr: Ptr<QGraphicsSceneEvent>, ) -> Ptr<QGraphicsSceneMoveEvent>
Calls C++ function: QGraphicsSceneMoveEvent* dynamic_cast<QGraphicsSceneMoveEvent*>(QGraphicsSceneEvent* ptr)
.
Source§impl StaticDowncast<QGraphicsSceneMoveEvent> for QEvent
impl StaticDowncast<QGraphicsSceneMoveEvent> for QEvent
Source§unsafe fn static_downcast(ptr: Ptr<QEvent>) -> Ptr<QGraphicsSceneMoveEvent>
unsafe fn static_downcast(ptr: Ptr<QEvent>) -> Ptr<QGraphicsSceneMoveEvent>
Calls C++ function: QGraphicsSceneMoveEvent* static_cast<QGraphicsSceneMoveEvent*>(QEvent* ptr)
.
Source§impl StaticDowncast<QGraphicsSceneMoveEvent> for QGraphicsSceneEvent
impl StaticDowncast<QGraphicsSceneMoveEvent> for QGraphicsSceneEvent
Source§unsafe fn static_downcast(
ptr: Ptr<QGraphicsSceneEvent>,
) -> Ptr<QGraphicsSceneMoveEvent>
unsafe fn static_downcast( ptr: Ptr<QGraphicsSceneEvent>, ) -> Ptr<QGraphicsSceneMoveEvent>
Calls C++ function: QGraphicsSceneMoveEvent* static_cast<QGraphicsSceneMoveEvent*>(QGraphicsSceneEvent* ptr)
.
Source§impl StaticUpcast<QEvent> for QGraphicsSceneMoveEvent
impl StaticUpcast<QEvent> for QGraphicsSceneMoveEvent
Source§unsafe fn static_upcast(ptr: Ptr<QGraphicsSceneMoveEvent>) -> Ptr<QEvent>
unsafe fn static_upcast(ptr: Ptr<QGraphicsSceneMoveEvent>) -> Ptr<QEvent>
Calls C++ function: QEvent* static_cast<QEvent*>(QGraphicsSceneMoveEvent* ptr)
.
Source§impl StaticUpcast<QGraphicsSceneEvent> for QGraphicsSceneMoveEvent
impl StaticUpcast<QGraphicsSceneEvent> for QGraphicsSceneMoveEvent
Source§unsafe fn static_upcast(
ptr: Ptr<QGraphicsSceneMoveEvent>,
) -> Ptr<QGraphicsSceneEvent>
unsafe fn static_upcast( ptr: Ptr<QGraphicsSceneMoveEvent>, ) -> Ptr<QGraphicsSceneEvent>
Calls C++ function: QGraphicsSceneEvent* static_cast<QGraphicsSceneEvent*>(QGraphicsSceneMoveEvent* ptr)
.