QGraphicsSceneMouseEvent

Synopsis

Functions

Detailed Description

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

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

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

class PySide.QtGui.QGraphicsSceneMouseEvent([type=None])
Parameters:typePySide.QtCore.QEvent.Type

Constructs a generic graphics scene mouse event of the specified type .

PySide.QtGui.QGraphicsSceneMouseEvent.button()
Return type:PySide.QtCore.Qt.MouseButton

Returns the mouse button (if any) that caused the event.

PySide.QtGui.QGraphicsSceneMouseEvent.buttonDownPos(button)
Parameters:buttonPySide.QtCore.Qt.MouseButton
Return type:PySide.QtCore.QPointF
PySide.QtGui.QGraphicsSceneMouseEvent.buttonDownScenePos(button)
Parameters:buttonPySide.QtCore.Qt.MouseButton
Return type:PySide.QtCore.QPointF
PySide.QtGui.QGraphicsSceneMouseEvent.buttonDownScreenPos(button)
Parameters:buttonPySide.QtCore.Qt.MouseButton
Return type:PySide.QtCore.QPoint
PySide.QtGui.QGraphicsSceneMouseEvent.buttons()
Return type:PySide.QtCore.Qt.MouseButtons

Returns the combination of mouse buttons that were pressed at the time the event was sent.

PySide.QtGui.QGraphicsSceneMouseEvent.lastPos()
Return type:PySide.QtCore.QPointF

Returns the last recorded mouse cursor position in item coordinates.

PySide.QtGui.QGraphicsSceneMouseEvent.lastScenePos()
Return type:PySide.QtCore.QPointF

Returns the last recorded mouse cursor position in scene coordinates. The last recorded position is the position of the previous mouse event received by the view that created the event.

PySide.QtGui.QGraphicsSceneMouseEvent.lastScreenPos()
Return type:PySide.QtCore.QPoint

Returns the last recorded mouse cursor position in screen coordinates. The last recorded position is the position of the previous mouse event received by the view that created the event.

PySide.QtGui.QGraphicsSceneMouseEvent.modifiers()
Return type:PySide.QtCore.Qt.KeyboardModifiers

Returns the keyboard modifiers in use at the time the event was sent.

PySide.QtGui.QGraphicsSceneMouseEvent.pos()
Return type:PySide.QtCore.QPointF

Returns the mouse cursor position in item coordinates.

PySide.QtGui.QGraphicsSceneMouseEvent.scenePos()
Return type:PySide.QtCore.QPointF

Returns the mouse cursor position in scene coordinates.

PySide.QtGui.QGraphicsSceneMouseEvent.screenPos()
Return type:PySide.QtCore.QPoint

Returns the mouse cursor position in screen coordinates.

PySide.QtGui.QGraphicsSceneMouseEvent.setButton(button)
Parameters:buttonPySide.QtCore.Qt.MouseButton
PySide.QtGui.QGraphicsSceneMouseEvent.setButtonDownPos(button, pos)
Parameters:
PySide.QtGui.QGraphicsSceneMouseEvent.setButtonDownScenePos(button, pos)
Parameters:
PySide.QtGui.QGraphicsSceneMouseEvent.setButtonDownScreenPos(button, pos)
Parameters:
PySide.QtGui.QGraphicsSceneMouseEvent.setButtons(buttons)
Parameters:buttonsPySide.QtCore.Qt.MouseButtons
PySide.QtGui.QGraphicsSceneMouseEvent.setLastPos(pos)
Parameters:posPySide.QtCore.QPointF
PySide.QtGui.QGraphicsSceneMouseEvent.setLastScenePos(pos)
Parameters:posPySide.QtCore.QPointF
PySide.QtGui.QGraphicsSceneMouseEvent.setLastScreenPos(pos)
Parameters:posPySide.QtCore.QPoint
PySide.QtGui.QGraphicsSceneMouseEvent.setModifiers(modifiers)
Parameters:modifiersPySide.QtCore.Qt.KeyboardModifiers
PySide.QtGui.QGraphicsSceneMouseEvent.setPos(pos)
Parameters:posPySide.QtCore.QPointF
PySide.QtGui.QGraphicsSceneMouseEvent.setScenePos(pos)
Parameters:posPySide.QtCore.QPointF
PySide.QtGui.QGraphicsSceneMouseEvent.setScreenPos(pos)
Parameters:posPySide.QtCore.QPoint