Table of Contents
- QGraphicsSceneContextMenuEvent
- Synopsis
- Detailed Description
PySide2.QtWidgets.QGraphicsSceneContextMenuEvent
PySide2.QtWidgets.QGraphicsSceneContextMenuEvent.Reason
PySide2.QtWidgets.QGraphicsSceneContextMenuEvent.modifiers()
PySide2.QtWidgets.QGraphicsSceneContextMenuEvent.pos()
PySide2.QtWidgets.QGraphicsSceneContextMenuEvent.reason()
PySide2.QtWidgets.QGraphicsSceneContextMenuEvent.scenePos()
PySide2.QtWidgets.QGraphicsSceneContextMenuEvent.screenPos()
PySide2.QtWidgets.QGraphicsSceneContextMenuEvent.setModifiers()
PySide2.QtWidgets.QGraphicsSceneContextMenuEvent.setPos()
PySide2.QtWidgets.QGraphicsSceneContextMenuEvent.setReason()
PySide2.QtWidgets.QGraphicsSceneContextMenuEvent.setScenePos()
PySide2.QtWidgets.QGraphicsSceneContextMenuEvent.setScreenPos()
Previous topic
Next topic
Quick search
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)
Detailed Description¶
A
QContextMenuEvent
received by aQGraphicsView
is translated into aQGraphicsSceneContextMenuEvent
. TheglobalPos()
is translated into item, scene, and screen coordinates (pos()
,scenePos()
, andscreenPos()
).See also
QGraphicsSceneMouseEvent
QGraphicsSceneWheelEvent
QContextMenuEvent
- class PySide2.QtWidgets.QGraphicsSceneContextMenuEvent([type=None])¶
- param type:
Constructs a graphics scene context menu event of the specified
type
.
- PySide2.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).
- PySide2.QtWidgets.QGraphicsSceneContextMenuEvent.modifiers()¶
- Return type:
KeyboardModifiers
Returns the keyboard modifiers in use when the context menu was requested.
- PySide2.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
- PySide2.QtWidgets.QGraphicsSceneContextMenuEvent.reason()¶
- Return type:
Returns the reason for the context menu event.
See also
Reason
- PySide2.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
- PySide2.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
- PySide2.QtWidgets.QGraphicsSceneContextMenuEvent.setModifiers(modifiers)¶
- Parameters:
modifiers –
KeyboardModifiers
Sets the keyboard modifiers associated with the context menu to the
modifiers
specified.See also
- PySide2.QtWidgets.QGraphicsSceneContextMenuEvent.setPos(pos)¶
- Parameters:
pos –
PySide2.QtCore.QPointF
See also
- PySide2.QtWidgets.QGraphicsSceneContextMenuEvent.setReason(reason)¶
- Parameters:
reason –
Reason
Sets the reason for the context menu event to
reason
.See also
- PySide2.QtWidgets.QGraphicsSceneContextMenuEvent.setScenePos(pos)¶
- Parameters:
pos –
PySide2.QtCore.QPointF
See also
- PySide2.QtWidgets.QGraphicsSceneContextMenuEvent.setScreenPos(pos)¶
- Parameters:
pos –
PySide2.QtCore.QPoint
See also
© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.