[][src]Struct qt_widgets::QGraphicsSceneContextMenuEvent

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

The QGraphicsSceneContextMenuEvent class provides context menu events in the graphics view framework.

C++ class: QGraphicsSceneContextMenuEvent.

C++ documentation:

The QGraphicsSceneContextMenuEvent class provides context menu events in the graphics view framework.

A QContextMenuEvent received by a QGraphicsView is translated into a QGraphicsSceneContextMenuEvent. The QContextMenuEvent::globalPos() is translated into item, scene, and screen coordinates (pos(), scenePos(), and screenPos()).

Methods

impl QGraphicsSceneContextMenuEvent[src]

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

Returns the keyboard modifiers in use when the context menu was requested.

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

C++ documentation:

Returns the keyboard modifiers in use when the context menu was requested.

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

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

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

The QGraphicsSceneContextMenuEvent class provides context menu events in the graphics view framework.

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

C++ documentation:

The QGraphicsSceneContextMenuEvent class provides context menu events in the graphics view framework.

A QContextMenuEvent received by a QGraphicsView is translated into a QGraphicsSceneContextMenuEvent. The QContextMenuEvent::globalPos() is translated into item, scene, and screen coordinates (pos(), scenePos(), and screenPos()).

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

Returns the position of the mouse cursor in item coordinates at the moment the context menu was requested.

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

C++ documentation:

Returns the position of the mouse cursor in item coordinates at the moment the context menu was requested.

See also scenePos() and screenPos().

pub unsafe fn reason(&self) -> Reason[src]

Returns the reason for the context menu event.

Calls C++ function: QGraphicsSceneContextMenuEvent::Reason QGraphicsSceneContextMenuEvent::reason() const.

C++ documentation:

Returns the reason for the context menu event.

See also QGraphicsSceneContextMenuEvent::Reason.

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

Returns the position of the mouse cursor in scene coordinates at the moment the context menu was requested.

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

C++ documentation:

Returns the position of the mouse cursor in scene coordinates at the moment the context menu was requested.

See also pos() and screenPos().

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

Returns the position of the mouse cursor in screen coordinates at the moment the context menu was requested.

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

C++ documentation:

Returns the position of the mouse cursor in screen coordinates at the moment the context menu was requested.

See also pos() and scenePos().

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

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

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

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

pub unsafe fn set_reason(&self, reason: Reason)[src]

Calls C++ function: void QGraphicsSceneContextMenuEvent::setReason(QGraphicsSceneContextMenuEvent::Reason reason).

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

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

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

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

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 QGraphicsSceneContextMenuEvent[src]

unsafe fn delete(&self)[src]

Destroys the event.

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

C++ documentation:

Destroys the event.

impl Deref for QGraphicsSceneContextMenuEvent[src]

type Target = QGraphicsSceneEvent

The resulting type after dereferencing.

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

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

impl DynamicCast<QGraphicsSceneContextMenuEvent> for QEvent[src]

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

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

impl StaticDowncast<QGraphicsSceneContextMenuEvent> for QEvent[src]

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

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

impl StaticUpcast<QEvent> for QGraphicsSceneContextMenuEvent[src]

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

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

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.