[][src]Struct qt_widgets::QGraphicsSceneEvent

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

The QGraphicsSceneEvent class provides a base class for all graphics view related events.

C++ class: QGraphicsSceneEvent.

C++ documentation:

The QGraphicsSceneEvent class provides a base class for all graphics view related events.

When a QGraphicsView receives Qt mouse, keyboard, and drag and drop events (QMouseEvent, QKeyEvent, QDragEvent, etc.), it translates them into instances of QGraphicsSceneEvent subclasses and forwards them to the QGraphicsScene it displays. The scene then forwards the events to the relevant items.

For example, when a QGraphicsView receives a QMouseEvent of type MousePress as a response to a user click, the view sends a QGraphicsSceneMouseEvent of type GraphicsSceneMousePress to the underlying QGraphicsScene through its mousePressEvent() function. The default QGraphicsScene::mousePressEvent() implementation determines which item was clicked and forwards the event to QGraphicsItem::mousePressEvent().

Subclasses such as QGraphicsSceneMouseEvent and QGraphicsSceneContextMenuEvent provide the coordinates from the original QEvent in screen, scene, and item coordinates (see screenPos(), scenePos(), and pos()). The item coordinates are set by the QGraphicsScene before it forwards the event to the event to a QGraphicsItem. The mouse events also add the possibility to retrieve the coordinates from the last event received by the view (see lastScreenPos(), lastScenePos(), and lastPos()).

Methods

impl QGraphicsSceneEvent[src]

pub unsafe fn new(type_: Type) -> CppBox<QGraphicsSceneEvent>[src]

Calls C++ function: [constructor] void QGraphicsSceneEvent::QGraphicsSceneEvent(QEvent::Type type).

pub unsafe fn set_widget(&mut self, widget: impl CastInto<MutPtr<QWidget>>)[src]

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

pub unsafe fn widget(&self) -> MutPtr<QWidget>[src]

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.

Trait Implementations

impl CppDeletable for QGraphicsSceneEvent[src]

unsafe fn delete(&mut self)[src]

Destroys the event.

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

C++ documentation:

Destroys the event.

impl Deref for QGraphicsSceneEvent[src]

type Target = QEvent

The resulting type after dereferencing.

fn deref(&self) -> &QEvent[src]

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

impl DerefMut for QGraphicsSceneEvent[src]

fn deref_mut(&mut self) -> &mut QEvent[src]

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

impl DynamicCast<QGraphicsSceneContextMenuEvent> for QGraphicsSceneEvent[src]

unsafe fn dynamic_cast(
    ptr: Ptr<QGraphicsSceneEvent>
) -> Ptr<QGraphicsSceneContextMenuEvent>
[src]

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

unsafe fn dynamic_cast_mut(
    ptr: MutPtr<QGraphicsSceneEvent>
) -> MutPtr<QGraphicsSceneContextMenuEvent>
[src]

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

impl DynamicCast<QGraphicsSceneDragDropEvent> for QGraphicsSceneEvent[src]

unsafe fn dynamic_cast(
    ptr: Ptr<QGraphicsSceneEvent>
) -> Ptr<QGraphicsSceneDragDropEvent>
[src]

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

unsafe fn dynamic_cast_mut(
    ptr: MutPtr<QGraphicsSceneEvent>
) -> MutPtr<QGraphicsSceneDragDropEvent>
[src]

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

impl DynamicCast<QGraphicsSceneEvent> for QEvent[src]

unsafe fn dynamic_cast(ptr: Ptr<QEvent>) -> Ptr<QGraphicsSceneEvent>[src]

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

unsafe fn dynamic_cast_mut(ptr: MutPtr<QEvent>) -> MutPtr<QGraphicsSceneEvent>[src]

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

impl DynamicCast<QGraphicsSceneHelpEvent> for QGraphicsSceneEvent[src]

unsafe fn dynamic_cast(
    ptr: Ptr<QGraphicsSceneEvent>
) -> Ptr<QGraphicsSceneHelpEvent>
[src]

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

unsafe fn dynamic_cast_mut(
    ptr: MutPtr<QGraphicsSceneEvent>
) -> MutPtr<QGraphicsSceneHelpEvent>
[src]

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

impl DynamicCast<QGraphicsSceneHoverEvent> for QGraphicsSceneEvent[src]

unsafe fn dynamic_cast(
    ptr: Ptr<QGraphicsSceneEvent>
) -> Ptr<QGraphicsSceneHoverEvent>
[src]

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

unsafe fn dynamic_cast_mut(
    ptr: MutPtr<QGraphicsSceneEvent>
) -> MutPtr<QGraphicsSceneHoverEvent>
[src]

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

impl DynamicCast<QGraphicsSceneMouseEvent> for QGraphicsSceneEvent[src]

unsafe fn dynamic_cast(
    ptr: Ptr<QGraphicsSceneEvent>
) -> Ptr<QGraphicsSceneMouseEvent>
[src]

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

unsafe fn dynamic_cast_mut(
    ptr: MutPtr<QGraphicsSceneEvent>
) -> MutPtr<QGraphicsSceneMouseEvent>
[src]

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

impl DynamicCast<QGraphicsSceneMoveEvent> for QGraphicsSceneEvent[src]

unsafe fn dynamic_cast(
    ptr: Ptr<QGraphicsSceneEvent>
) -> Ptr<QGraphicsSceneMoveEvent>
[src]

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

unsafe fn dynamic_cast_mut(
    ptr: MutPtr<QGraphicsSceneEvent>
) -> MutPtr<QGraphicsSceneMoveEvent>
[src]

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

impl DynamicCast<QGraphicsSceneResizeEvent> for QGraphicsSceneEvent[src]

unsafe fn dynamic_cast(
    ptr: Ptr<QGraphicsSceneEvent>
) -> Ptr<QGraphicsSceneResizeEvent>
[src]

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

unsafe fn dynamic_cast_mut(
    ptr: MutPtr<QGraphicsSceneEvent>
) -> MutPtr<QGraphicsSceneResizeEvent>
[src]

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

impl DynamicCast<QGraphicsSceneWheelEvent> for QGraphicsSceneEvent[src]

unsafe fn dynamic_cast(
    ptr: Ptr<QGraphicsSceneEvent>
) -> Ptr<QGraphicsSceneWheelEvent>
[src]

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

unsafe fn dynamic_cast_mut(
    ptr: MutPtr<QGraphicsSceneEvent>
) -> MutPtr<QGraphicsSceneWheelEvent>
[src]

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

impl StaticDowncast<QGraphicsSceneContextMenuEvent> for QGraphicsSceneEvent[src]

unsafe fn static_downcast(
    ptr: Ptr<QGraphicsSceneEvent>
) -> Ptr<QGraphicsSceneContextMenuEvent>
[src]

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

unsafe fn static_downcast_mut(
    ptr: MutPtr<QGraphicsSceneEvent>
) -> MutPtr<QGraphicsSceneContextMenuEvent>
[src]

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

impl StaticDowncast<QGraphicsSceneDragDropEvent> for QGraphicsSceneEvent[src]

unsafe fn static_downcast(
    ptr: Ptr<QGraphicsSceneEvent>
) -> Ptr<QGraphicsSceneDragDropEvent>
[src]

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

unsafe fn static_downcast_mut(
    ptr: MutPtr<QGraphicsSceneEvent>
) -> MutPtr<QGraphicsSceneDragDropEvent>
[src]

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

impl StaticDowncast<QGraphicsSceneEvent> for QEvent[src]

unsafe fn static_downcast(ptr: Ptr<QEvent>) -> Ptr<QGraphicsSceneEvent>[src]

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

unsafe fn static_downcast_mut(
    ptr: MutPtr<QEvent>
) -> MutPtr<QGraphicsSceneEvent>
[src]

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

impl StaticDowncast<QGraphicsSceneHelpEvent> for QGraphicsSceneEvent[src]

unsafe fn static_downcast(
    ptr: Ptr<QGraphicsSceneEvent>
) -> Ptr<QGraphicsSceneHelpEvent>
[src]

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

unsafe fn static_downcast_mut(
    ptr: MutPtr<QGraphicsSceneEvent>
) -> MutPtr<QGraphicsSceneHelpEvent>
[src]

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

impl StaticDowncast<QGraphicsSceneHoverEvent> for QGraphicsSceneEvent[src]

unsafe fn static_downcast(
    ptr: Ptr<QGraphicsSceneEvent>
) -> Ptr<QGraphicsSceneHoverEvent>
[src]

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

unsafe fn static_downcast_mut(
    ptr: MutPtr<QGraphicsSceneEvent>
) -> MutPtr<QGraphicsSceneHoverEvent>
[src]

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

impl StaticDowncast<QGraphicsSceneMouseEvent> for QGraphicsSceneEvent[src]

unsafe fn static_downcast(
    ptr: Ptr<QGraphicsSceneEvent>
) -> Ptr<QGraphicsSceneMouseEvent>
[src]

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

unsafe fn static_downcast_mut(
    ptr: MutPtr<QGraphicsSceneEvent>
) -> MutPtr<QGraphicsSceneMouseEvent>
[src]

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

impl StaticDowncast<QGraphicsSceneMoveEvent> for QGraphicsSceneEvent[src]

unsafe fn static_downcast(
    ptr: Ptr<QGraphicsSceneEvent>
) -> Ptr<QGraphicsSceneMoveEvent>
[src]

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

unsafe fn static_downcast_mut(
    ptr: MutPtr<QGraphicsSceneEvent>
) -> MutPtr<QGraphicsSceneMoveEvent>
[src]

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

impl StaticDowncast<QGraphicsSceneResizeEvent> for QGraphicsSceneEvent[src]

unsafe fn static_downcast(
    ptr: Ptr<QGraphicsSceneEvent>
) -> Ptr<QGraphicsSceneResizeEvent>
[src]

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

unsafe fn static_downcast_mut(
    ptr: MutPtr<QGraphicsSceneEvent>
) -> MutPtr<QGraphicsSceneResizeEvent>
[src]

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

impl StaticDowncast<QGraphicsSceneWheelEvent> for QGraphicsSceneEvent[src]

unsafe fn static_downcast(
    ptr: Ptr<QGraphicsSceneEvent>
) -> Ptr<QGraphicsSceneWheelEvent>
[src]

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

unsafe fn static_downcast_mut(
    ptr: MutPtr<QGraphicsSceneEvent>
) -> MutPtr<QGraphicsSceneWheelEvent>
[src]

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

impl StaticUpcast<QEvent> for QGraphicsSceneEvent[src]

unsafe fn static_upcast(ptr: Ptr<QGraphicsSceneEvent>) -> Ptr<QEvent>[src]

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

unsafe fn static_upcast_mut(ptr: MutPtr<QGraphicsSceneEvent>) -> MutPtr<QEvent>[src]

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

impl StaticUpcast<QGraphicsSceneEvent> for QGraphicsSceneMouseEvent[src]

unsafe fn static_upcast(
    ptr: Ptr<QGraphicsSceneMouseEvent>
) -> Ptr<QGraphicsSceneEvent>
[src]

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

unsafe fn static_upcast_mut(
    ptr: MutPtr<QGraphicsSceneMouseEvent>
) -> MutPtr<QGraphicsSceneEvent>
[src]

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

impl StaticUpcast<QGraphicsSceneEvent> for QGraphicsSceneWheelEvent[src]

unsafe fn static_upcast(
    ptr: Ptr<QGraphicsSceneWheelEvent>
) -> Ptr<QGraphicsSceneEvent>
[src]

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

unsafe fn static_upcast_mut(
    ptr: MutPtr<QGraphicsSceneWheelEvent>
) -> MutPtr<QGraphicsSceneEvent>
[src]

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

impl StaticUpcast<QGraphicsSceneEvent> for QGraphicsSceneContextMenuEvent[src]

unsafe fn static_upcast(
    ptr: Ptr<QGraphicsSceneContextMenuEvent>
) -> Ptr<QGraphicsSceneEvent>
[src]

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

unsafe fn static_upcast_mut(
    ptr: MutPtr<QGraphicsSceneContextMenuEvent>
) -> MutPtr<QGraphicsSceneEvent>
[src]

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

impl StaticUpcast<QGraphicsSceneEvent> for QGraphicsSceneHoverEvent[src]

unsafe fn static_upcast(
    ptr: Ptr<QGraphicsSceneHoverEvent>
) -> Ptr<QGraphicsSceneEvent>
[src]

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

unsafe fn static_upcast_mut(
    ptr: MutPtr<QGraphicsSceneHoverEvent>
) -> MutPtr<QGraphicsSceneEvent>
[src]

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

impl StaticUpcast<QGraphicsSceneEvent> for QGraphicsSceneHelpEvent[src]

unsafe fn static_upcast(
    ptr: Ptr<QGraphicsSceneHelpEvent>
) -> Ptr<QGraphicsSceneEvent>
[src]

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

unsafe fn static_upcast_mut(
    ptr: MutPtr<QGraphicsSceneHelpEvent>
) -> MutPtr<QGraphicsSceneEvent>
[src]

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

impl StaticUpcast<QGraphicsSceneEvent> for QGraphicsSceneDragDropEvent[src]

unsafe fn static_upcast(
    ptr: Ptr<QGraphicsSceneDragDropEvent>
) -> Ptr<QGraphicsSceneEvent>
[src]

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

unsafe fn static_upcast_mut(
    ptr: MutPtr<QGraphicsSceneDragDropEvent>
) -> MutPtr<QGraphicsSceneEvent>
[src]

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

impl StaticUpcast<QGraphicsSceneEvent> for QGraphicsSceneResizeEvent[src]

unsafe fn static_upcast(
    ptr: Ptr<QGraphicsSceneResizeEvent>
) -> Ptr<QGraphicsSceneEvent>
[src]

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

unsafe fn static_upcast_mut(
    ptr: MutPtr<QGraphicsSceneResizeEvent>
) -> MutPtr<QGraphicsSceneEvent>
[src]

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

impl StaticUpcast<QGraphicsSceneEvent> for QGraphicsSceneMoveEvent[src]

unsafe fn static_upcast(
    ptr: Ptr<QGraphicsSceneMoveEvent>
) -> Ptr<QGraphicsSceneEvent>
[src]

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

unsafe fn static_upcast_mut(
    ptr: MutPtr<QGraphicsSceneMoveEvent>
) -> MutPtr<QGraphicsSceneEvent>
[src]

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

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.