[][src]Struct qt_gui::QContextMenuEvent

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

The QContextMenuEvent class contains parameters that describe a context menu event.

C++ class: QContextMenuEvent.

C++ documentation:

The QContextMenuEvent class contains parameters that describe a context menu event.

Context menu events are sent to widgets when a user performs an action associated with opening a context menu. The actions required to open context menus vary between platforms; for example, on Windows, pressing the menu button or clicking the right mouse button will cause this event to be sent.

When this event occurs it is customary to show a QMenu with a context menu, if this is relevant to the context.

Context menu events contain a special accept flag that indicates whether the receiver accepted the event. If the event handler does not accept the event then, if possible, whatever triggered the event will be handled as a regular input event.

Methods

impl QContextMenuEvent[src]

pub unsafe fn copy_from(
    &self,
    other: impl CastInto<Ref<QContextMenuEvent>>
) -> Ref<QContextMenuEvent>
[src]

The QContextMenuEvent class contains parameters that describe a context menu event.

Calls C++ function: QContextMenuEvent& QContextMenuEvent::operator=(const QContextMenuEvent& other).

C++ documentation:

The QContextMenuEvent class contains parameters that describe a context menu event.

Context menu events are sent to widgets when a user performs an action associated with opening a context menu. The actions required to open context menus vary between platforms; for example, on Windows, pressing the menu button or clicking the right mouse button will cause this event to be sent.

When this event occurs it is customary to show a QMenu with a context menu, if this is relevant to the context.

Context menu events contain a special accept flag that indicates whether the receiver accepted the event. If the event handler does not accept the event then, if possible, whatever triggered the event will be handled as a regular input event.

pub unsafe fn global_pos(&self) -> Ref<QPoint>[src]

Returns the global position of the mouse pointer at the time of the event.

Calls C++ function: const QPoint& QContextMenuEvent::globalPos() const.

C++ documentation:

Returns the global position of the mouse pointer at the time of the event.

See also x(), y(), and pos().

pub unsafe fn global_x(&self) -> c_int[src]

Returns the global x position of the mouse pointer at the time of the event.

Calls C++ function: int QContextMenuEvent::globalX() const.

C++ documentation:

Returns the global x position of the mouse pointer at the time of the event.

See also globalY() and globalPos().

pub unsafe fn global_y(&self) -> c_int[src]

Returns the global y position of the mouse pointer at the time of the event.

Calls C++ function: int QContextMenuEvent::globalY() const.

C++ documentation:

Returns the global y position of the mouse pointer at the time of the event.

See also globalX() and globalPos().

pub unsafe fn new_4a(
    reason: Reason,
    pos: impl CastInto<Ref<QPoint>>,
    global_pos: impl CastInto<Ref<QPoint>>,
    modifiers: QFlags<KeyboardModifier>
) -> CppBox<QContextMenuEvent>
[src]

Constructs a context menu event object with the accept parameter flag set to false.

Calls C++ function: [constructor] void QContextMenuEvent::QContextMenuEvent(QContextMenuEvent::Reason reason, const QPoint& pos, const QPoint& globalPos, QFlags<Qt::KeyboardModifier> modifiers).

C++ documentation:

Constructs a context menu event object with the accept parameter flag set to false.

The reason parameter must be QContextMenuEvent::Mouse or QContextMenuEvent::Keyboard.

The pos parameter specifies the mouse position relative to the receiving widget. globalPos is the mouse position in absolute coordinates. The modifiers holds the keyboard modifiers.

pub unsafe fn new_3a(
    reason: Reason,
    pos: impl CastInto<Ref<QPoint>>,
    global_pos: impl CastInto<Ref<QPoint>>
) -> CppBox<QContextMenuEvent>
[src]

Constructs a context menu event object with the accept parameter flag set to false.

Calls C++ function: [constructor] void QContextMenuEvent::QContextMenuEvent(QContextMenuEvent::Reason reason, const QPoint& pos, const QPoint& globalPos).

C++ documentation:

Constructs a context menu event object with the accept parameter flag set to false.

The reason parameter must be QContextMenuEvent::Mouse or QContextMenuEvent::Keyboard.

The pos parameter specifies the mouse position relative to the receiving widget. globalPos is the mouse position in absolute coordinates.

pub unsafe fn new_2a(
    reason: Reason,
    pos: impl CastInto<Ref<QPoint>>
) -> CppBox<QContextMenuEvent>
[src]

Constructs a context menu event object with the accept parameter flag set to false.

Calls C++ function: [constructor] void QContextMenuEvent::QContextMenuEvent(QContextMenuEvent::Reason reason, const QPoint& pos).

C++ documentation:

Constructs a context menu event object with the accept parameter flag set to false.

The reason parameter must be QContextMenuEvent::Mouse or QContextMenuEvent::Keyboard.

The pos parameter specifies the mouse position relative to the receiving widget.

The globalPos() is initialized to QCursor::pos(), which may not be appropriate. Use the other constructor to specify the global position explicitly.

pub unsafe fn new_copy(
    other: impl CastInto<Ref<QContextMenuEvent>>
) -> CppBox<QContextMenuEvent>
[src]

The QContextMenuEvent class contains parameters that describe a context menu event.

Calls C++ function: [constructor] void QContextMenuEvent::QContextMenuEvent(const QContextMenuEvent& other).

C++ documentation:

The QContextMenuEvent class contains parameters that describe a context menu event.

Context menu events are sent to widgets when a user performs an action associated with opening a context menu. The actions required to open context menus vary between platforms; for example, on Windows, pressing the menu button or clicking the right mouse button will cause this event to be sent.

When this event occurs it is customary to show a QMenu with a context menu, if this is relevant to the context.

Context menu events contain a special accept flag that indicates whether the receiver accepted the event. If the event handler does not accept the event then, if possible, whatever triggered the event will be handled as a regular input event.

pub unsafe fn pos(&self) -> Ref<QPoint>[src]

Returns the position of the mouse pointer relative to the widget that received the event.

Calls C++ function: const QPoint& QContextMenuEvent::pos() const.

C++ documentation:

Returns the position of the mouse pointer relative to the widget that received the event.

See also x(), y(), and globalPos().

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

Returns the reason for this context event.

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

C++ documentation:

Returns the reason for this context event.

pub unsafe fn x(&self) -> c_int[src]

Returns the x position of the mouse pointer, relative to the widget that received the event.

Calls C++ function: int QContextMenuEvent::x() const.

C++ documentation:

Returns the x position of the mouse pointer, relative to the widget that received the event.

See also y() and pos().

pub unsafe fn y(&self) -> c_int[src]

Returns the y position of the mouse pointer, relative to the widget that received the event.

Calls C++ function: int QContextMenuEvent::y() const.

C++ documentation:

Returns the y position of the mouse pointer, relative to the widget that received the event.

See also x() and pos().

Methods from Deref<Target = QInputEvent>

pub unsafe fn copy_from(
    &self,
    other: impl CastInto<Ref<QInputEvent>>
) -> Ref<QInputEvent>
[src]

The QInputEvent class is the base class for events that describe user input.

Calls C++ function: QInputEvent& QInputEvent::operator=(const QInputEvent& other).

C++ documentation:

The QInputEvent class is the base class for events that describe user input.

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

Returns the keyboard modifier flags that existed immediately before the event occurred.

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

C++ documentation:

Returns the keyboard modifier flags that existed immediately before the event occurred.

See also QGuiApplication::keyboardModifiers().

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

Calls C++ function: void QInputEvent::setModifiers(QFlags<Qt::KeyboardModifier> amodifiers).

pub unsafe fn set_timestamp(&self, atimestamp: c_ulong)[src]

Calls C++ function: void QInputEvent::setTimestamp(unsigned long atimestamp).

pub unsafe fn timestamp(&self) -> c_ulong[src]

Returns the window system's timestamp for this event. It will normally be in milliseconds since some arbitrary point in time, such as the time when the system was started.

Calls C++ function: unsigned long QInputEvent::timestamp() const.

C++ documentation:

Returns the window system's timestamp for this event. It will normally be in milliseconds since some arbitrary point in time, such as the time when the system was started.

Trait Implementations

impl CppDeletable for QContextMenuEvent[src]

unsafe fn delete(&self)[src]

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

impl Deref for QContextMenuEvent[src]

type Target = QInputEvent

The resulting type after dereferencing.

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

Calls C++ function: QInputEvent* static_cast<QInputEvent*>(QContextMenuEvent* ptr).

impl DynamicCast<QContextMenuEvent> for QInputEvent[src]

unsafe fn dynamic_cast(ptr: Ptr<QInputEvent>) -> Ptr<QContextMenuEvent>[src]

Calls C++ function: QContextMenuEvent* dynamic_cast<QContextMenuEvent*>(QInputEvent* ptr).

impl DynamicCast<QContextMenuEvent> for QEvent[src]

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

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

impl StaticDowncast<QContextMenuEvent> for QInputEvent[src]

unsafe fn static_downcast(ptr: Ptr<QInputEvent>) -> Ptr<QContextMenuEvent>[src]

Calls C++ function: QContextMenuEvent* static_cast<QContextMenuEvent*>(QInputEvent* ptr).

impl StaticDowncast<QContextMenuEvent> for QEvent[src]

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

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

impl StaticUpcast<QEvent> for QContextMenuEvent[src]

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

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

impl StaticUpcast<QInputEvent> for QContextMenuEvent[src]

unsafe fn static_upcast(ptr: Ptr<QContextMenuEvent>) -> Ptr<QInputEvent>[src]

Calls C++ function: QInputEvent* static_cast<QInputEvent*>(QContextMenuEvent* 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.