内容表

上一话题

QGraphicsSceneHoverEvent

下一话题

QGraphicsSceneMoveEvent

QGraphicsSceneMouseEvent

QGraphicsSceneMouseEvent class provides mouse events in the graphics view framework. 更多 …

Inheritance diagram of PySide2.QtWidgets.QGraphicsSceneMouseEvent

概要

函数

详细描述

当 QGraphicsView 接收 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() ,和 screenPos() ), mouse events also contain the coordinates of the previous mouse event received by the view. These can be retrieved with lastPos() , lastScreenPos() ,和 lastScenePos() .

class QGraphicsSceneMouseEvent ( [ type=None ] )
param type

Type

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

PySide2.QtWidgets.QGraphicsSceneMouseEvent. button ( )
返回类型

MouseButton

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

PySide2.QtWidgets.QGraphicsSceneMouseEvent. buttonDownPos ( button )
参数

button – MouseButton

返回类型

QPointF

Returns the mouse cursor position in item coordinates where the specified button was clicked.

PySide2.QtWidgets.QGraphicsSceneMouseEvent. buttonDownScenePos ( button )
参数

button – MouseButton

返回类型

QPointF

Returns the mouse cursor position in scene coordinates where the specified button was clicked.

PySide2.QtWidgets.QGraphicsSceneMouseEvent. buttonDownScreenPos ( button )
参数

button – MouseButton

返回类型

QPoint

Returns the mouse cursor position in screen coordinates where the specified button was clicked.

PySide2.QtWidgets.QGraphicsSceneMouseEvent. buttons ( )
返回类型

MouseButtons

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

PySide2.QtWidgets.QGraphicsSceneMouseEvent. flags ( )
返回类型

MouseEventFlags

返回鼠标事件标志。

The mouse event flags provide additional information about a mouse event.

另请参阅

MouseEventFlag flags()

PySide2.QtWidgets.QGraphicsSceneMouseEvent. lastPos ( )
返回类型

QPointF

Returns the last recorded mouse cursor position in item coordinates.

PySide2.QtWidgets.QGraphicsSceneMouseEvent. lastScenePos ( )
返回类型

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.

PySide2.QtWidgets.QGraphicsSceneMouseEvent. lastScreenPos ( )
返回类型

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.

PySide2.QtWidgets.QGraphicsSceneMouseEvent. modifiers ( )
返回类型

KeyboardModifiers

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

PySide2.QtWidgets.QGraphicsSceneMouseEvent. pos ( )
返回类型

QPointF

Returns the mouse cursor position in item coordinates.

PySide2.QtWidgets.QGraphicsSceneMouseEvent. scenePos ( )
返回类型

QPointF

Returns the mouse cursor position in scene coordinates.

PySide2.QtWidgets.QGraphicsSceneMouseEvent. screenPos ( )
返回类型

QPoint

Returns the mouse cursor position in screen coordinates.

PySide2.QtWidgets.QGraphicsSceneMouseEvent. setButton ( button )
参数

button – MouseButton

另请参阅

button()

PySide2.QtWidgets.QGraphicsSceneMouseEvent. setButtonDownPos ( button , pos )
参数
  • button – MouseButton

  • pos – QPointF

另请参阅

buttonDownPos()

PySide2.QtWidgets.QGraphicsSceneMouseEvent. setButtonDownScenePos ( button , pos )
参数
  • button – MouseButton

  • pos – QPointF

PySide2.QtWidgets.QGraphicsSceneMouseEvent. setButtonDownScreenPos ( button , pos )
参数
  • button – MouseButton

  • pos – QPoint

PySide2.QtWidgets.QGraphicsSceneMouseEvent. setButtons ( buttons )
参数

buttons – MouseButtons

另请参阅

buttons()

PySide2.QtWidgets.QGraphicsSceneMouseEvent. setFlags ( arg__1 )
参数

arg__1 – MouseEventFlags

另请参阅

flags()

PySide2.QtWidgets.QGraphicsSceneMouseEvent. setLastPos ( pos )
参数

pos – QPointF

另请参阅

lastPos()

PySide2.QtWidgets.QGraphicsSceneMouseEvent. setLastScenePos ( pos )
参数

pos – QPointF

另请参阅

lastScenePos()

PySide2.QtWidgets.QGraphicsSceneMouseEvent. setLastScreenPos ( pos )
参数

pos – QPoint

另请参阅

lastScreenPos()

PySide2.QtWidgets.QGraphicsSceneMouseEvent. setModifiers ( modifiers )
参数

modifiers – KeyboardModifiers

另请参阅

modifiers()

PySide2.QtWidgets.QGraphicsSceneMouseEvent. setPos ( pos )
参数

pos – QPointF

另请参阅

pos()

PySide2.QtWidgets.QGraphicsSceneMouseEvent. setScenePos ( pos )
参数

pos – QPointF

另请参阅

scenePos()

PySide2.QtWidgets.QGraphicsSceneMouseEvent. setScreenPos ( pos )
参数

pos – QPoint

另请参阅

screenPos()

PySide2.QtWidgets.QGraphicsSceneMouseEvent. setSource ( source )
参数

source – MouseEventSource

另请参阅

source()

PySide2.QtWidgets.QGraphicsSceneMouseEvent. source ( )
返回类型

MouseEventSource

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.

另请参阅

MouseEventSource source()