QGraphicsSceneMouseEventclass provides mouse events in the graphics view framework. 更多 …
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
()
当
QGraphicsView接收QMouseEvent, it translates it to aQGraphicsSceneMouseEvent. The event is then forwarded to theQGraphicsSceneassociated 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(),和screenPos()), mouse events also contain the coordinates of the previous mouse event received by the view. These can be retrieved withlastPos(),lastScreenPos(),和lastScenePos().
QGraphicsSceneMouseEvent
(
[
type=None
]
)
¶
- param type
Type
Constructs a generic graphics scene mouse event of the specified
type
.
MouseButton
Returns the mouse button (if any) that caused the event.
另请参阅
button
–
MouseButton
QPointF
Returns the mouse cursor position in item coordinates where the specified
button
was clicked.
button
–
MouseButton
QPointF
Returns the mouse cursor position in scene coordinates where the specified
button
was clicked.
button
–
MouseButton
QPoint
Returns the mouse cursor position in screen coordinates where the specified
button
was clicked.
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
另请参阅
PySide2.QtWidgets.QGraphicsSceneMouseEvent.
setButtonDownPos
(
button
,
pos
)
¶
button
–
MouseButton
pos
–
QPointF
另请参阅
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
另请参阅
PySide2.QtWidgets.QGraphicsSceneMouseEvent.
setFlags
(
arg__1
)
¶
arg__1
–
MouseEventFlags
另请参阅
PySide2.QtWidgets.QGraphicsSceneMouseEvent.
setLastScenePos
(
pos
)
¶
pos
–
QPointF
另请参阅
PySide2.QtWidgets.QGraphicsSceneMouseEvent.
setLastScreenPos
(
pos
)
¶
pos
–
QPoint
另请参阅
PySide2.QtWidgets.QGraphicsSceneMouseEvent.
setModifiers
(
modifiers
)
¶
modifiers
–
KeyboardModifiers
另请参阅
PySide2.QtWidgets.QGraphicsSceneMouseEvent.
setScenePos
(
pos
)
¶
pos
–
QPointF
另请参阅
PySide2.QtWidgets.QGraphicsSceneMouseEvent.
setScreenPos
(
pos
)
¶
pos
–
QPoint
另请参阅
PySide2.QtWidgets.QGraphicsSceneMouseEvent.
setSource
(
source
)
¶
source
–
MouseEventSource
另请参阅
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()