QGraphicsSceneContextMenuEvent#
The QGraphicsSceneContextMenuEvent
class provides context menu events in the graphics view framework. More…
Synopsis#
Functions#
def
modifiers
()def
pos
()def
reason
()def
scenePos
()def
screenPos
()def
setModifiers
(modifiers)def
setPos
(pos)def
setReason
(reason)def
setScenePos
(pos)def
setScreenPos
(pos)
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
Detailed Description#
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()
).
See also
QGraphicsSceneMouseEvent
QGraphicsSceneWheelEvent
QContextMenuEvent
- class PySide6.QtWidgets.QGraphicsSceneContextMenuEvent([type=QEvent.Type.None])#
- Parameters:
type –
Type
- PySide6.QtWidgets.QGraphicsSceneContextMenuEvent.Reason#
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 macOS, 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).
- PySide6.QtWidgets.QGraphicsSceneContextMenuEvent.modifiers()#
- Return type:
Combination of
Qt.KeyboardModifier
Returns the keyboard modifiers in use when the context menu was requested.
- PySide6.QtWidgets.QGraphicsSceneContextMenuEvent.pos()#
- Return type:
Returns the position of the mouse cursor in item coordinates at the moment the context menu was requested.
See also
Returns the reason for the context menu event.
See also
Reason
- PySide6.QtWidgets.QGraphicsSceneContextMenuEvent.scenePos()#
- Return type:
Returns the position of the mouse cursor in scene coordinates at the moment the context menu was requested.
See also
- PySide6.QtWidgets.QGraphicsSceneContextMenuEvent.screenPos()#
- Return type:
Returns the position of the mouse cursor in screen coordinates at the moment the context menu was requested.
See also
- PySide6.QtWidgets.QGraphicsSceneContextMenuEvent.setModifiers(modifiers)#
- Parameters:
modifiers – Combination of
Qt.KeyboardModifier
- PySide6.QtWidgets.QGraphicsSceneContextMenuEvent.setPos(pos)#
- Parameters:
pos –
PySide6.QtCore.QPointF
- PySide6.QtWidgets.QGraphicsSceneContextMenuEvent.setScenePos(pos)#
- Parameters:
pos –
PySide6.QtCore.QPointF
- PySide6.QtWidgets.QGraphicsSceneContextMenuEvent.setScreenPos(pos)#
- Parameters:
pos –
PySide6.QtCore.QPoint