QGraphicsSceneEventclass provides a base class for all graphics view related events. More…
Inherited by: QGraphicsSceneContextMenuEvent, QGraphicsSceneDragDropEvent, QGraphicsSceneHelpEvent, QGraphicsSceneHoverEvent, QGraphicsSceneMouseEvent, QGraphicsSceneMoveEvent, QGraphicsSceneResizeEvent, QGraphicsSceneWheelEvent
QGraphicsViewreceives Qt mouse, keyboard, and drag and drop events (
QKeyEvent, QDragEvent, etc.), it translates them into instances of
QGraphicsSceneEventsubclasses and forwards them to the
QGraphicsSceneit displays. The scene then forwards the events to the relevant items.
For example, when a
QMouseEventof type MousePress as a response to a user click, the view sends a
GraphicsSceneMousePressto the underlying
mousePressEvent()function. The default
mousePressEvent()implementation determines which item was clicked and forwards the event to
Subclasses such as
QGraphicsSceneContextMenuEventprovide the coordinates from the original
QEventin screen, scene, and item coordinates (see
pos()). The item coordinates are set by the
QGraphicsScenebefore it forwards the event to the event to a
QGraphicsItem. The mouse events also add the possibility to retrieve the coordinates from the last event received by the view (see
- class PySide2.QtWidgets.QGraphicsSceneEvent(type)¶
- param type:
Constructs a generic graphics scene event of the specified
- Return type:
Returns the widget where the event originated, or
Noneif the event originates from another application.
© 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.