QGraphicsSceneMouseEvent¶
The
QGraphicsSceneMouseEvent
class provides mouse events in the graphics view framework. More…
Synopsis¶
Functions¶
def
button
()def
buttonDownPos
(button)def
buttonDownScenePos
(button)def
buttonDownScreenPos
(button)def
buttons
()def
flags
()def
lastPos
()def
lastScenePos
()def
lastScreenPos
()def
modifiers
()def
pos
()def
scenePos
()def
screenPos
()def
setButton
(button)def
setButtonDownPos
(button, pos)def
setButtonDownScenePos
(button, pos)def
setButtonDownScreenPos
(button, pos)def
setButtons
(buttons)def
setFlags
(arg__1)def
setLastPos
(pos)def
setLastScenePos
(pos)def
setLastScreenPos
(pos)def
setModifiers
(modifiers)def
setPos
(pos)def
setScenePos
(pos)def
setScreenPos
(pos)def
setSource
(source)def
source
()
Detailed Description¶
When a
QGraphicsView
receives aQMouseEvent
, it translates it to aQGraphicsSceneMouseEvent
. The event is then forwarded to theQGraphicsScene
associated with the view. If the event is not handled by the scene, the view may use it, e.g., for theDragMode
.In addition to containing the item, scene, and screen coordinates of the event (as
pos()
,scenePos()
, andscreenPos()
), mouse events also contain the coordinates of the previous mouse event received by the view. These can be retrieved withlastPos()
,lastScreenPos()
, andlastScenePos()
.See also
QGraphicsSceneContextMenuEvent
QGraphicsSceneHoverEvent
QGraphicsSceneWheelEvent
QMouseEvent
- class PySide2.QtWidgets.QGraphicsSceneMouseEvent([type=None])¶
- param type:
Constructs a generic graphics scene mouse event of the specified
type
.
- PySide2.QtWidgets.QGraphicsSceneMouseEvent.button()¶
- Return type:
Returns the mouse button (if any) that caused the event.
See also
- PySide2.QtWidgets.QGraphicsSceneMouseEvent.buttonDownPos(button)¶
- Parameters:
button –
MouseButton
- Return type:
Returns the mouse cursor position in item coordinates where the specified
button
was clicked.
- PySide2.QtWidgets.QGraphicsSceneMouseEvent.buttonDownScenePos(button)¶
- Parameters:
button –
MouseButton
- Return type:
Returns the mouse cursor position in scene coordinates where the specified
button
was clicked.
- PySide2.QtWidgets.QGraphicsSceneMouseEvent.buttonDownScreenPos(button)¶
- Parameters:
button –
MouseButton
- Return type:
Returns the mouse cursor position in screen coordinates where the specified
button
was clicked.
- PySide2.QtWidgets.QGraphicsSceneMouseEvent.buttons()¶
- Return type:
MouseButtons
Returns the combination of mouse buttons that were pressed at the time the event was sent.
See also
- PySide2.QtWidgets.QGraphicsSceneMouseEvent.flags()¶
- Return type:
MouseEventFlags
Returns the mouse event flags.
The mouse event flags provide additional information about a mouse event.
See also
MouseEventFlag
flags()
- PySide2.QtWidgets.QGraphicsSceneMouseEvent.lastPos()¶
- Return type:
Returns the last recorded mouse cursor position in item coordinates.
See also
- PySide2.QtWidgets.QGraphicsSceneMouseEvent.lastScenePos()¶
- Return type:
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.
See also
- PySide2.QtWidgets.QGraphicsSceneMouseEvent.lastScreenPos()¶
- Return type:
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.
See also
- PySide2.QtWidgets.QGraphicsSceneMouseEvent.modifiers()¶
- Return type:
KeyboardModifiers
Returns the keyboard modifiers in use at the time the event was sent.
- PySide2.QtWidgets.QGraphicsSceneMouseEvent.pos()¶
- Return type:
Returns the mouse cursor position in item coordinates.
See also
- PySide2.QtWidgets.QGraphicsSceneMouseEvent.scenePos()¶
- Return type:
Returns the mouse cursor position in scene coordinates.
See also
- PySide2.QtWidgets.QGraphicsSceneMouseEvent.screenPos()¶
- Return type:
Returns the mouse cursor position in screen coordinates.
See also
- PySide2.QtWidgets.QGraphicsSceneMouseEvent.setButton(button)¶
- Parameters:
button –
MouseButton
See also
- PySide2.QtWidgets.QGraphicsSceneMouseEvent.setButtonDownPos(button, pos)¶
- Parameters:
button –
MouseButton
pos –
PySide2.QtCore.QPointF
See also
- PySide2.QtWidgets.QGraphicsSceneMouseEvent.setButtonDownScenePos(button, pos)¶
- Parameters:
button –
MouseButton
pos –
PySide2.QtCore.QPointF
See also
- PySide2.QtWidgets.QGraphicsSceneMouseEvent.setButtonDownScreenPos(button, pos)¶
- Parameters:
button –
MouseButton
pos –
PySide2.QtCore.QPoint
See also
- PySide2.QtWidgets.QGraphicsSceneMouseEvent.setButtons(buttons)¶
- Parameters:
buttons –
MouseButtons
See also
- PySide2.QtWidgets.QGraphicsSceneMouseEvent.setFlags(arg__1)¶
- Parameters:
arg__1 –
MouseEventFlags
See also
- PySide2.QtWidgets.QGraphicsSceneMouseEvent.setLastPos(pos)¶
- Parameters:
pos –
PySide2.QtCore.QPointF
See also
- PySide2.QtWidgets.QGraphicsSceneMouseEvent.setLastScenePos(pos)¶
- Parameters:
pos –
PySide2.QtCore.QPointF
See also
- PySide2.QtWidgets.QGraphicsSceneMouseEvent.setLastScreenPos(pos)¶
- Parameters:
pos –
PySide2.QtCore.QPoint
See also
- PySide2.QtWidgets.QGraphicsSceneMouseEvent.setModifiers(modifiers)¶
- Parameters:
modifiers –
KeyboardModifiers
See also
- PySide2.QtWidgets.QGraphicsSceneMouseEvent.setPos(pos)¶
- Parameters:
pos –
PySide2.QtCore.QPointF
See also
- PySide2.QtWidgets.QGraphicsSceneMouseEvent.setScenePos(pos)¶
- Parameters:
pos –
PySide2.QtCore.QPointF
See also
- PySide2.QtWidgets.QGraphicsSceneMouseEvent.setScreenPos(pos)¶
- Parameters:
pos –
PySide2.QtCore.QPoint
See also
- PySide2.QtWidgets.QGraphicsSceneMouseEvent.setSource(source)¶
- Parameters:
source –
MouseEventSource
See also
- PySide2.QtWidgets.QGraphicsSceneMouseEvent.source()¶
- Return type:
Returns information about the mouse event source.
The mouse event source can be used to distinguish between genuine and artificial mouse events. The latter are events that are synthesized from touch events by the operating system or Qt itself.
See also
MouseEventSource
source()
© 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.