QGraphicsSceneMouseEvent Class

The QGraphicsSceneMouseEvent class provides mouse events in the graphics view framework. More...

Header: #include <QGraphicsSceneMouseEvent>
qmake: QT += widgets
Since: Qt 4.2
Inherits: QGraphicsSceneEvent

This class was introduced in Qt 4.2.

Detailed Description

When a QGraphicsView receives a QMouseEvent, it translates it to a QGraphicsSceneMouseEvent. The event is then forwarded to the QGraphicsScene associated with the view. If the event is not handled by the scene, the view may use it, e.g., for the DragMode.

In addition to containing the item, scene, and screen coordinates of the event (as pos(), scenePos(), and screenPos()), mouse events also contain the coordinates of the previous mouse event received by the view. These can be retrieved with lastPos(), lastScreenPos(), and lastScenePos().

See also QGraphicsSceneContextMenuEvent, QGraphicsSceneHoverEvent, QGraphicsSceneWheelEvent, and QMouseEvent.