QGraphicsSceneContextMenuEvent 類

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

頭: #include <QGraphicsSceneContextMenuEvent>
qmake: QT += widgets
Since: Qt 4.2
繼承: QGraphicsSceneEvent

公共類型

enum Reason { Mouse, Keyboard, Other }

公共函數

~QGraphicsSceneContextMenuEvent ()
Qt::KeyboardModifiers modifiers () const
QPointF pos () const
Reason reason () const
QPointF scenePos () const
QPoint screenPos () const

額外繼承成員

詳細描述

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

A QContextMenuEvent 接收通過 QGraphicsView is translated into a QGraphicsSceneContextMenuEvent QContextMenuEvent::globalPos () 被翻譯成項、場景及屏幕坐標 ( pos (), scenePos (),和 screenPos ()).

另請參閱 QGraphicsSceneMouseEvent , QGraphicsSceneWheelEvent ,和 QContextMenuEvent .

成員類型文檔編製

enum QGraphicsSceneContextMenuEvent:: Reason

此枚舉描述為什麼發送上下文事件的原因。

常量 描述
QGraphicsSceneContextMenuEvent::Mouse 0 The mouse caused the event to be sent. On most platforms, this means the right mouse button was clicked.
QGraphicsSceneContextMenuEvent::Keyboard 1 The keyboard caused this event to be sent. On Windows and macOS, this means the menu button was pressed.
QGraphicsSceneContextMenuEvent::Other 2 事件是通過某些其它手段發送的 (即:不通過鼠標或鍵盤)。

成員函數文檔編製

QGraphicsSceneContextMenuEvent:: ~QGraphicsSceneContextMenuEvent ()

銷毀事件。

Qt::KeyboardModifiers QGraphicsSceneContextMenuEvent:: modifiers () const

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

QPointF QGraphicsSceneContextMenuEvent:: pos () const

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

另請參閱 scenePos () 和 screenPos ().

Reason QGraphicsSceneContextMenuEvent:: reason () const

Returns the reason for the context menu event.

另請參閱 QGraphicsSceneContextMenuEvent::Reason .

QPointF QGraphicsSceneContextMenuEvent:: scenePos () const

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

另請參閱 pos () 和 screenPos ().

QPoint QGraphicsSceneContextMenuEvent:: screenPos () const

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

另請參閱 pos () 和 scenePos ().