#[repr(C)]pub struct QGraphicsSceneContextMenuEvent { /* private fields */ }
Expand description
The QGraphicsSceneContextMenuEvent class provides context menu events in the graphics view framework.
C++ class: QGraphicsSceneContextMenuEvent
.
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()).
Implementations§
Source§impl QGraphicsSceneContextMenuEvent
impl QGraphicsSceneContextMenuEvent
Sourcepub unsafe fn modifiers(&self) -> QFlags<KeyboardModifier>
pub unsafe fn modifiers(&self) -> QFlags<KeyboardModifier>
Returns the keyboard modifiers in use when the context menu was requested.
Calls C++ function: QFlags<Qt::KeyboardModifier> QGraphicsSceneContextMenuEvent::modifiers() const
.
Returns the keyboard modifiers in use when the context menu was requested.
Sourcepub unsafe fn new_1a(type_: Type) -> CppBox<QGraphicsSceneContextMenuEvent>
pub unsafe fn new_1a(type_: Type) -> CppBox<QGraphicsSceneContextMenuEvent>
Calls C++ function: [constructor] void QGraphicsSceneContextMenuEvent::QGraphicsSceneContextMenuEvent(QEvent::Type type = …)
.
Sourcepub unsafe fn new_0a() -> CppBox<QGraphicsSceneContextMenuEvent>
pub unsafe fn new_0a() -> CppBox<QGraphicsSceneContextMenuEvent>
The QGraphicsSceneContextMenuEvent class provides context menu events in the graphics view framework.
Calls C++ function: [constructor] void QGraphicsSceneContextMenuEvent::QGraphicsSceneContextMenuEvent()
.
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()).
Sourcepub unsafe fn pos(&self) -> CppBox<QPointF>
pub unsafe fn pos(&self) -> CppBox<QPointF>
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
.
Sourcepub unsafe fn reason(&self) -> Reason
pub unsafe fn reason(&self) -> Reason
Returns the reason for the context menu event.
Calls C++ function: QGraphicsSceneContextMenuEvent::Reason QGraphicsSceneContextMenuEvent::reason() const
.
Returns the reason for the context menu event.
See also QGraphicsSceneContextMenuEvent::Reason.
Sourcepub unsafe fn scene_pos(&self) -> CppBox<QPointF>
pub unsafe fn scene_pos(&self) -> CppBox<QPointF>
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
.
Sourcepub unsafe fn screen_pos(&self) -> CppBox<QPoint>
pub unsafe fn screen_pos(&self) -> CppBox<QPoint>
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
.
Sourcepub unsafe fn set_modifiers(&self, modifiers: QFlags<KeyboardModifier>)
pub unsafe fn set_modifiers(&self, modifiers: QFlags<KeyboardModifier>)
Calls C++ function: void QGraphicsSceneContextMenuEvent::setModifiers(QFlags<Qt::KeyboardModifier> modifiers)
.
Sourcepub unsafe fn set_pos(&self, pos: impl CastInto<Ref<QPointF>>)
pub unsafe fn set_pos(&self, pos: impl CastInto<Ref<QPointF>>)
Calls C++ function: void QGraphicsSceneContextMenuEvent::setPos(const QPointF& pos)
.
Sourcepub unsafe fn set_reason(&self, reason: Reason)
pub unsafe fn set_reason(&self, reason: Reason)
Calls C++ function: void QGraphicsSceneContextMenuEvent::setReason(QGraphicsSceneContextMenuEvent::Reason reason)
.
Sourcepub unsafe fn set_scene_pos(&self, pos: impl CastInto<Ref<QPointF>>)
pub unsafe fn set_scene_pos(&self, pos: impl CastInto<Ref<QPointF>>)
Calls C++ function: void QGraphicsSceneContextMenuEvent::setScenePos(const QPointF& pos)
.
Sourcepub unsafe fn set_screen_pos(&self, pos: impl CastInto<Ref<QPoint>>)
pub unsafe fn set_screen_pos(&self, pos: impl CastInto<Ref<QPoint>>)
Calls C++ function: void QGraphicsSceneContextMenuEvent::setScreenPos(const QPoint& 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 QGraphicsSceneContextMenuEvent
impl CppDeletable for QGraphicsSceneContextMenuEvent
Source§impl Deref for QGraphicsSceneContextMenuEvent
impl Deref for QGraphicsSceneContextMenuEvent
Source§fn deref(&self) -> &QGraphicsSceneEvent
fn deref(&self) -> &QGraphicsSceneEvent
Calls C++ function: QGraphicsSceneEvent* static_cast<QGraphicsSceneEvent*>(QGraphicsSceneContextMenuEvent* ptr)
.
Source§type Target = QGraphicsSceneEvent
type Target = QGraphicsSceneEvent
Source§impl DynamicCast<QGraphicsSceneContextMenuEvent> for QEvent
impl DynamicCast<QGraphicsSceneContextMenuEvent> for QEvent
Source§unsafe fn dynamic_cast(ptr: Ptr<QEvent>) -> Ptr<QGraphicsSceneContextMenuEvent>
unsafe fn dynamic_cast(ptr: Ptr<QEvent>) -> Ptr<QGraphicsSceneContextMenuEvent>
Calls C++ function: QGraphicsSceneContextMenuEvent* dynamic_cast<QGraphicsSceneContextMenuEvent*>(QEvent* ptr)
.
Source§impl DynamicCast<QGraphicsSceneContextMenuEvent> for QGraphicsSceneEvent
impl DynamicCast<QGraphicsSceneContextMenuEvent> for QGraphicsSceneEvent
Source§unsafe fn dynamic_cast(
ptr: Ptr<QGraphicsSceneEvent>,
) -> Ptr<QGraphicsSceneContextMenuEvent>
unsafe fn dynamic_cast( ptr: Ptr<QGraphicsSceneEvent>, ) -> Ptr<QGraphicsSceneContextMenuEvent>
Calls C++ function: QGraphicsSceneContextMenuEvent* dynamic_cast<QGraphicsSceneContextMenuEvent*>(QGraphicsSceneEvent* ptr)
.
Source§impl StaticDowncast<QGraphicsSceneContextMenuEvent> for QEvent
impl StaticDowncast<QGraphicsSceneContextMenuEvent> for QEvent
Source§unsafe fn static_downcast(
ptr: Ptr<QEvent>,
) -> Ptr<QGraphicsSceneContextMenuEvent>
unsafe fn static_downcast( ptr: Ptr<QEvent>, ) -> Ptr<QGraphicsSceneContextMenuEvent>
Calls C++ function: QGraphicsSceneContextMenuEvent* static_cast<QGraphicsSceneContextMenuEvent*>(QEvent* ptr)
.
Source§impl StaticDowncast<QGraphicsSceneContextMenuEvent> for QGraphicsSceneEvent
impl StaticDowncast<QGraphicsSceneContextMenuEvent> for QGraphicsSceneEvent
Source§unsafe fn static_downcast(
ptr: Ptr<QGraphicsSceneEvent>,
) -> Ptr<QGraphicsSceneContextMenuEvent>
unsafe fn static_downcast( ptr: Ptr<QGraphicsSceneEvent>, ) -> Ptr<QGraphicsSceneContextMenuEvent>
Calls C++ function: QGraphicsSceneContextMenuEvent* static_cast<QGraphicsSceneContextMenuEvent*>(QGraphicsSceneEvent* ptr)
.
Source§impl StaticUpcast<QEvent> for QGraphicsSceneContextMenuEvent
impl StaticUpcast<QEvent> for QGraphicsSceneContextMenuEvent
Source§unsafe fn static_upcast(ptr: Ptr<QGraphicsSceneContextMenuEvent>) -> Ptr<QEvent>
unsafe fn static_upcast(ptr: Ptr<QGraphicsSceneContextMenuEvent>) -> Ptr<QEvent>
Calls C++ function: QEvent* static_cast<QEvent*>(QGraphicsSceneContextMenuEvent* ptr)
.
Source§impl StaticUpcast<QGraphicsSceneEvent> for QGraphicsSceneContextMenuEvent
impl StaticUpcast<QGraphicsSceneEvent> for QGraphicsSceneContextMenuEvent
Source§unsafe fn static_upcast(
ptr: Ptr<QGraphicsSceneContextMenuEvent>,
) -> Ptr<QGraphicsSceneEvent>
unsafe fn static_upcast( ptr: Ptr<QGraphicsSceneContextMenuEvent>, ) -> Ptr<QGraphicsSceneEvent>
Calls C++ function: QGraphicsSceneEvent* static_cast<QGraphicsSceneEvent*>(QGraphicsSceneContextMenuEvent* ptr)
.