[−][src]Struct qt_widgets::QGraphicsSceneEvent
The QGraphicsSceneEvent class provides a base class for all graphics view related events.
C++ class: QGraphicsSceneEvent
.
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(&self, widget: impl CastInto<Ptr<QWidget>>)
[src]
Calls C++ function: void QGraphicsSceneEvent::setWidget(QWidget* widget)
.
pub unsafe fn widget(&self) -> QPtr<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
.
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(&self)
[src]
Destroys the event.
Calls C++ function: virtual [destructor] void QGraphicsSceneEvent::~QGraphicsSceneEvent()
.
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 DynamicCast<QGraphicsSceneContextMenuEvent> for QGraphicsSceneEvent
[src]
unsafe fn dynamic_cast(
ptr: Ptr<QGraphicsSceneEvent>
) -> Ptr<QGraphicsSceneContextMenuEvent>
[src]
ptr: Ptr<QGraphicsSceneEvent>
) -> Ptr<QGraphicsSceneContextMenuEvent>
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]
ptr: Ptr<QGraphicsSceneEvent>
) -> Ptr<QGraphicsSceneDragDropEvent>
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)
.
impl DynamicCast<QGraphicsSceneHelpEvent> for QGraphicsSceneEvent
[src]
unsafe fn dynamic_cast(
ptr: Ptr<QGraphicsSceneEvent>
) -> Ptr<QGraphicsSceneHelpEvent>
[src]
ptr: Ptr<QGraphicsSceneEvent>
) -> Ptr<QGraphicsSceneHelpEvent>
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]
ptr: Ptr<QGraphicsSceneEvent>
) -> Ptr<QGraphicsSceneHoverEvent>
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]
ptr: Ptr<QGraphicsSceneEvent>
) -> Ptr<QGraphicsSceneMouseEvent>
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]
ptr: Ptr<QGraphicsSceneEvent>
) -> Ptr<QGraphicsSceneMoveEvent>
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]
ptr: Ptr<QGraphicsSceneEvent>
) -> Ptr<QGraphicsSceneResizeEvent>
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]
ptr: Ptr<QGraphicsSceneEvent>
) -> Ptr<QGraphicsSceneWheelEvent>
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]
ptr: Ptr<QGraphicsSceneEvent>
) -> Ptr<QGraphicsSceneContextMenuEvent>
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]
ptr: Ptr<QGraphicsSceneEvent>
) -> Ptr<QGraphicsSceneDragDropEvent>
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)
.
impl StaticDowncast<QGraphicsSceneHelpEvent> for QGraphicsSceneEvent
[src]
unsafe fn static_downcast(
ptr: Ptr<QGraphicsSceneEvent>
) -> Ptr<QGraphicsSceneHelpEvent>
[src]
ptr: Ptr<QGraphicsSceneEvent>
) -> Ptr<QGraphicsSceneHelpEvent>
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]
ptr: Ptr<QGraphicsSceneEvent>
) -> Ptr<QGraphicsSceneHoverEvent>
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]
ptr: Ptr<QGraphicsSceneEvent>
) -> Ptr<QGraphicsSceneMouseEvent>
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]
ptr: Ptr<QGraphicsSceneEvent>
) -> Ptr<QGraphicsSceneMoveEvent>
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]
ptr: Ptr<QGraphicsSceneEvent>
) -> Ptr<QGraphicsSceneResizeEvent>
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]
ptr: Ptr<QGraphicsSceneEvent>
) -> Ptr<QGraphicsSceneWheelEvent>
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)
.
impl StaticUpcast<QGraphicsSceneEvent> for QGraphicsSceneMouseEvent
[src]
unsafe fn static_upcast(
ptr: Ptr<QGraphicsSceneMouseEvent>
) -> Ptr<QGraphicsSceneEvent>
[src]
ptr: Ptr<QGraphicsSceneMouseEvent>
) -> Ptr<QGraphicsSceneEvent>
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]
ptr: Ptr<QGraphicsSceneWheelEvent>
) -> Ptr<QGraphicsSceneEvent>
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]
ptr: Ptr<QGraphicsSceneContextMenuEvent>
) -> Ptr<QGraphicsSceneEvent>
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]
ptr: Ptr<QGraphicsSceneHoverEvent>
) -> Ptr<QGraphicsSceneEvent>
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]
ptr: Ptr<QGraphicsSceneHelpEvent>
) -> Ptr<QGraphicsSceneEvent>
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]
ptr: Ptr<QGraphicsSceneDragDropEvent>
) -> Ptr<QGraphicsSceneEvent>
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]
ptr: Ptr<QGraphicsSceneResizeEvent>
) -> Ptr<QGraphicsSceneEvent>
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]
ptr: Ptr<QGraphicsSceneMoveEvent>
) -> Ptr<QGraphicsSceneEvent>
Calls C++ function: QGraphicsSceneEvent* static_cast<QGraphicsSceneEvent*>(QGraphicsSceneMoveEvent* ptr)
.
Auto Trait Implementations
impl RefUnwindSafe for QGraphicsSceneEvent
impl Send for QGraphicsSceneEvent
impl Sync for QGraphicsSceneEvent
impl Unpin for QGraphicsSceneEvent
impl UnwindSafe for QGraphicsSceneEvent
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> CastInto<U> for T where
U: CastFrom<T>,
[src]
U: CastFrom<T>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> StaticUpcast<T> for T
[src]
unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>
[src]
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>,