The 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 . The QContextMenuEvent.globalPos() is translated into item, scene, and screen coordinates ( PySide.QtGui.QGraphicsSceneContextMenuEvent.pos() , PySide.QtGui.QGraphicsSceneContextMenuEvent.scenePos() , and PySide.QtGui.QGraphicsSceneContextMenuEvent.screenPos() ).
| Parameters: | 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.
| Constant | Description |
|---|---|
| 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). |
| Return type: | PySide.QtCore.Qt.KeyboardModifiers |
|---|
Returns the keyboard modifiers in use when the context menu was requested.
| Return type: | PySide.QtCore.QPointF |
|---|
Returns the position of the mouse cursor in item coordinates at the moment the context menu was requested.
| Return type: | PySide.QtGui.QGraphicsSceneContextMenuEvent.Reason |
|---|
Returns the reason for the context menu event.
See also
QGraphicsSceneContextMenuEvent.Reason
| Return type: | PySide.QtCore.QPointF |
|---|
Returns the position of the mouse cursor in scene coordinates at the moment the the context menu was requested.
| Return type: | PySide.QtCore.QPoint |
|---|
Returns the position of the mouse cursor in screen coordinates at the moment the the context menu was requested.
| Parameters: | modifiers – PySide.QtCore.Qt.KeyboardModifiers |
|---|
| Parameters: | pos – PySide.QtCore.QPointF |
|---|
Sets the position associated with the context menu to the given point in item coordinates.
| Parameters: | reason – PySide.QtGui.QGraphicsSceneContextMenuEvent.Reason |
|---|
Sets the reason for the context menu event to reason .
| Parameters: | pos – PySide.QtCore.QPointF |
|---|
Sets the position associated with the context menu to the given point in scene coordinates.
| Parameters: | pos – PySide.QtCore.QPoint |
|---|
Sets the position associated with the context menu to the given point in screen coordinates.
