PySide.QtGui.QGraphicsSceneContextMenuEvent class provides context menu events in the graphics view framework.
A PySide.QtGui.QContextMenuEvent received by a PySide.QtGui.QGraphicsView is translated into a PySide.QtGui.QGraphicsSceneContextMenuEvent 。 QContextMenuEvent.globalPos() is translated into item, scene, and screen coordinates ( PySide.QtGui.QGraphicsSceneContextMenuEvent.pos() , PySide.QtGui.QGraphicsSceneContextMenuEvent.scenePos() ,和 PySide.QtGui.QGraphicsSceneContextMenuEvent.screenPos() ).
| 参数: | type – PySide.QtCore.QEvent.Type |
|---|
Constructs a graphics scene context menu event of the specified type .
This enum describes the reason why the context event was sent.
| 常量 | 描述 |
|---|---|
| QGraphicsSceneContextMenuEvent.Mouse | The mouse caused the event to be sent. On most platforms, this means the right mouse button was clicked. |
| QGraphicsSceneContextMenuEvent.Keyboard | The keyboard caused this event to be sent. On Windows and Mac OS X, this means the menu button was pressed. |
| QGraphicsSceneContextMenuEvent.Other | The event was sent by some other means (i.e. not by the mouse or keyboard). |
| 返回类型: | PySide.QtCore.Qt.KeyboardModifiers |
|---|
Returns the keyboard modifiers in use when the context menu was requested.
| 返回类型: | PySide.QtCore.QPointF |
|---|
Returns the position of the mouse cursor in item coordinates at the moment the context menu was requested.
| 返回类型: | PySide.QtGui.QGraphicsSceneContextMenuEvent.Reason |
|---|
Returns the reason for the context menu event.
另请参阅
QGraphicsSceneContextMenuEvent.Reason
| 返回类型: | PySide.QtCore.QPointF |
|---|
Returns the position of the mouse cursor in scene coordinates at the moment the the context menu was requested.
| 返回类型: | PySide.QtCore.QPoint |
|---|
Returns the position of the mouse cursor in screen coordinates at the moment the the context menu was requested.
| 参数: | modifiers – PySide.QtCore.Qt.KeyboardModifiers |
|---|
| 参数: | pos – PySide.QtCore.QPointF |
|---|
Sets the position associated with the context menu to the given point in item coordinates.
| 参数: | reason – PySide.QtGui.QGraphicsSceneContextMenuEvent.Reason |
|---|
Sets the reason for the context menu event to reason .
| 参数: | pos – PySide.QtCore.QPointF |
|---|
Sets the position associated with the context menu to the given point in scene coordinates.
| 参数: | pos – PySide.QtCore.QPoint |
|---|
Sets the position associated with the context menu to the given point in screen coordinates.