[][src]Struct qt_widgets::QGraphicsSceneMouseEvent

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

The QGraphicsSceneMouseEvent class provides mouse events in the graphics view framework.

C++ class: QGraphicsSceneMouseEvent.

C++ documentation:

The QGraphicsSceneMouseEvent class provides mouse events in the graphics view framework.

When a QGraphicsView receives a QMouseEvent, it translates it to a QGraphicsSceneMouseEvent. The event is then forwarded to the QGraphicsScene associated with the view. If the event is not handled by the scene, the view may use it, e.g., for the DragMode.

In addition to containing the item, scene, and screen coordinates of the event (as pos(), scenePos(), and screenPos()), mouse events also contain the coordinates of the previous mouse event received by the view. These can be retrieved with lastPos(), lastScreenPos(), and lastScenePos().

Methods

impl QGraphicsSceneMouseEvent[src]

pub unsafe fn button(&self) -> MouseButton[src]

Returns the mouse button (if any) that caused the event.

Calls C++ function: Qt::MouseButton QGraphicsSceneMouseEvent::button() const.

C++ documentation:

Returns the mouse button (if any) that caused the event.

See also buttons() and modifiers().

pub unsafe fn button_down_pos(&self, button: MouseButton) -> CppBox<QPointF>[src]

Returns the mouse cursor position in item coordinates where the specified button was clicked.

Calls C++ function: QPointF QGraphicsSceneMouseEvent::buttonDownPos(Qt::MouseButton button) const.

C++ documentation:

Returns the mouse cursor position in item coordinates where the specified button was clicked.

See also buttonDownScenePos(), buttonDownScreenPos(), and pos().

pub unsafe fn button_down_scene_pos(
    &self,
    button: MouseButton
) -> CppBox<QPointF>
[src]

Returns the mouse cursor position in scene coordinates where the specified button was clicked.

Calls C++ function: QPointF QGraphicsSceneMouseEvent::buttonDownScenePos(Qt::MouseButton button) const.

C++ documentation:

Returns the mouse cursor position in scene coordinates where the specified button was clicked.

See also buttonDownPos(), buttonDownScreenPos(), and scenePos().

pub unsafe fn button_down_screen_pos(
    &self,
    button: MouseButton
) -> CppBox<QPoint>
[src]

Returns the mouse cursor position in screen coordinates where the specified button was clicked.

Calls C++ function: QPoint QGraphicsSceneMouseEvent::buttonDownScreenPos(Qt::MouseButton button) const.

C++ documentation:

Returns the mouse cursor position in screen coordinates where the specified button was clicked.

See also screenPos(), buttonDownPos(), and buttonDownScenePos().

pub unsafe fn buttons(&self) -> QFlags<MouseButton>[src]

Returns the combination of mouse buttons that were pressed at the time the event was sent.

Calls C++ function: QFlags<Qt::MouseButton> QGraphicsSceneMouseEvent::buttons() const.

C++ documentation:

Returns the combination of mouse buttons that were pressed at the time the event was sent.

See also button() and modifiers().

pub unsafe fn flags(&self) -> QFlags<MouseEventFlag>[src]

Returns the mouse event flags.

Calls C++ function: QFlags<Qt::MouseEventFlag> QGraphicsSceneMouseEvent::flags() const.

C++ documentation:

Returns the mouse event flags.

The mouse event flags provide additional information about a mouse event.

This function was introduced in Qt 5.4.

See also Qt::MouseEventFlag and QMouseEvent::flags().

pub unsafe fn last_pos(&self) -> CppBox<QPointF>[src]

Returns the last recorded mouse cursor position in item coordinates.

Calls C++ function: QPointF QGraphicsSceneMouseEvent::lastPos() const.

C++ documentation:

Returns the last recorded mouse cursor position in item coordinates.

See also lastScenePos(), lastScreenPos(), and pos().

pub unsafe fn last_scene_pos(&self) -> CppBox<QPointF>[src]

Returns the last recorded mouse cursor position in scene coordinates. The last recorded position is the position of the previous mouse event received by the view that created the event.

Calls C++ function: QPointF QGraphicsSceneMouseEvent::lastScenePos() const.

C++ documentation:

Returns the last recorded mouse cursor position in scene coordinates. The last recorded position is the position of the previous mouse event received by the view that created the event.

See also lastPos(), lastScreenPos(), and scenePos().

pub unsafe fn last_screen_pos(&self) -> CppBox<QPoint>[src]

Returns the last recorded mouse cursor position in screen coordinates. The last recorded position is the position of the previous mouse event received by the view that created the event.

Calls C++ function: QPoint QGraphicsSceneMouseEvent::lastScreenPos() const.

C++ documentation:

Returns the last recorded mouse cursor position in screen coordinates. The last recorded position is the position of the previous mouse event received by the view that created the event.

See also lastPos(), lastScenePos(), and screenPos().

pub unsafe fn modifiers(&self) -> QFlags<KeyboardModifier>[src]

Returns the keyboard modifiers in use at the time the event was sent.

Calls C++ function: QFlags<Qt::KeyboardModifier> QGraphicsSceneMouseEvent::modifiers() const.

C++ documentation:

Returns the keyboard modifiers in use at the time the event was sent.

See also buttons() and button().

pub unsafe fn new_1a(type_: Type) -> CppBox<QGraphicsSceneMouseEvent>[src]

Calls C++ function: [constructor] void QGraphicsSceneMouseEvent::QGraphicsSceneMouseEvent(QEvent::Type type = …).

pub unsafe fn new_0a() -> CppBox<QGraphicsSceneMouseEvent>[src]

The QGraphicsSceneMouseEvent class provides mouse events in the graphics view framework.

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

C++ documentation:

The QGraphicsSceneMouseEvent class provides mouse events in the graphics view framework.

When a QGraphicsView receives a QMouseEvent, it translates it to a QGraphicsSceneMouseEvent. The event is then forwarded to the QGraphicsScene associated with the view. If the event is not handled by the scene, the view may use it, e.g., for the DragMode.

In addition to containing the item, scene, and screen coordinates of the event (as pos(), scenePos(), and screenPos()), mouse events also contain the coordinates of the previous mouse event received by the view. These can be retrieved with lastPos(), lastScreenPos(), and lastScenePos().

pub unsafe fn pos(&self) -> CppBox<QPointF>[src]

Returns the mouse cursor position in item coordinates.

Calls C++ function: QPointF QGraphicsSceneMouseEvent::pos() const.

C++ documentation:

Returns the mouse cursor position in item coordinates.

See also scenePos(), screenPos(), and lastPos().

pub unsafe fn scene_pos(&self) -> CppBox<QPointF>[src]

Returns the mouse cursor position in scene coordinates.

Calls C++ function: QPointF QGraphicsSceneMouseEvent::scenePos() const.

C++ documentation:

Returns the mouse cursor position in scene coordinates.

See also pos(), screenPos(), and lastScenePos().

pub unsafe fn screen_pos(&self) -> CppBox<QPoint>[src]

Returns the mouse cursor position in screen coordinates.

Calls C++ function: QPoint QGraphicsSceneMouseEvent::screenPos() const.

C++ documentation:

Returns the mouse cursor position in screen coordinates.

See also pos(), scenePos(), and lastScreenPos().

pub unsafe fn set_button(&self, button: MouseButton)[src]

Calls C++ function: void QGraphicsSceneMouseEvent::setButton(Qt::MouseButton button).

pub unsafe fn set_button_down_pos(
    &self,
    button: MouseButton,
    pos: impl CastInto<Ref<QPointF>>
)
[src]

Calls C++ function: void QGraphicsSceneMouseEvent::setButtonDownPos(Qt::MouseButton button, const QPointF& pos).

pub unsafe fn set_button_down_scene_pos(
    &self,
    button: MouseButton,
    pos: impl CastInto<Ref<QPointF>>
)
[src]

Calls C++ function: void QGraphicsSceneMouseEvent::setButtonDownScenePos(Qt::MouseButton button, const QPointF& pos).

pub unsafe fn set_button_down_screen_pos(
    &self,
    button: MouseButton,
    pos: impl CastInto<Ref<QPoint>>
)
[src]

Calls C++ function: void QGraphicsSceneMouseEvent::setButtonDownScreenPos(Qt::MouseButton button, const QPoint& pos).

pub unsafe fn set_buttons(&self, buttons: QFlags<MouseButton>)[src]

Calls C++ function: void QGraphicsSceneMouseEvent::setButtons(QFlags<Qt::MouseButton> buttons).

pub unsafe fn set_flags(&self, arg1: QFlags<MouseEventFlag>)[src]

Calls C++ function: void QGraphicsSceneMouseEvent::setFlags(QFlags<Qt::MouseEventFlag> arg1).

pub unsafe fn set_last_pos(&self, pos: impl CastInto<Ref<QPointF>>)[src]

Calls C++ function: void QGraphicsSceneMouseEvent::setLastPos(const QPointF& pos).

pub unsafe fn set_last_scene_pos(&self, pos: impl CastInto<Ref<QPointF>>)[src]

Calls C++ function: void QGraphicsSceneMouseEvent::setLastScenePos(const QPointF& pos).

pub unsafe fn set_last_screen_pos(&self, pos: impl CastInto<Ref<QPoint>>)[src]

Calls C++ function: void QGraphicsSceneMouseEvent::setLastScreenPos(const QPoint& pos).

pub unsafe fn set_modifiers(&self, modifiers: QFlags<KeyboardModifier>)[src]

Calls C++ function: void QGraphicsSceneMouseEvent::setModifiers(QFlags<Qt::KeyboardModifier> modifiers).

pub unsafe fn set_pos(&self, pos: impl CastInto<Ref<QPointF>>)[src]

Calls C++ function: void QGraphicsSceneMouseEvent::setPos(const QPointF& pos).

pub unsafe fn set_scene_pos(&self, pos: impl CastInto<Ref<QPointF>>)[src]

Calls C++ function: void QGraphicsSceneMouseEvent::setScenePos(const QPointF& pos).

pub unsafe fn set_screen_pos(&self, pos: impl CastInto<Ref<QPoint>>)[src]

Calls C++ function: void QGraphicsSceneMouseEvent::setScreenPos(const QPoint& pos).

pub unsafe fn set_source(&self, source: MouseEventSource)[src]

Calls C++ function: void QGraphicsSceneMouseEvent::setSource(Qt::MouseEventSource source).

pub unsafe fn source(&self) -> MouseEventSource[src]

Returns information about the mouse event source.

Calls C++ function: Qt::MouseEventSource QGraphicsSceneMouseEvent::source() const.

C++ documentation:

Returns information about the mouse event source.

The mouse event source can be used to distinguish between genuine and artificial mouse events. The latter are events that are synthesized from touch events by the operating system or Qt itself.

This function was introduced in Qt 5.4.

See also Qt::MouseEventSource and QMouseEvent::source().

Methods from Deref<Target = QGraphicsSceneEvent>

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.

C++ documentation:

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

Trait Implementations

impl CppDeletable for QGraphicsSceneMouseEvent[src]

unsafe fn delete(&self)[src]

Destroys the event.

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

C++ documentation:

Destroys the event.

impl Deref for QGraphicsSceneMouseEvent[src]

type Target = QGraphicsSceneEvent

The resulting type after dereferencing.

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

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

impl DynamicCast<QGraphicsSceneMouseEvent> for QEvent[src]

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

Calls C++ function: QGraphicsSceneMouseEvent* dynamic_cast<QGraphicsSceneMouseEvent*>(QEvent* 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).

impl StaticDowncast<QGraphicsSceneMouseEvent> for QEvent[src]

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

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

impl StaticUpcast<QEvent> for QGraphicsSceneMouseEvent[src]

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

Calls C++ function: QEvent* static_cast<QEvent*>(QGraphicsSceneMouseEvent* 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).

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.