QMouseEvent#

The Qt3DCore::QMouseEvent contains parameters that describe a mouse event. More

Inheritance diagram of PySide6.Qt3DInput.Qt3DInput.QMouseEvent

Synopsis#

Properties#

Functions#

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

Detailed Description#

Mouse events occur when a mouse button is pressed and the ray traversing the view, originating from the mouse position intersects with one or more elements of the scene.

See also

QKeyEvent QWheelEvent QMouseHandler

class PySide6.Qt3DInput.Qt3DInput.QMouseEvent(e)#
Parameters:

ePySide6.QtGui.QMouseEvent

Constructs a new QMouseEvent instance for the QMouseEvent e.

Note

Properties can be used directly when from __feature__ import true_property is used or via accessor functions otherwise.

property PᅟySide6.Qt3DInput.Qt3DInput.QMouseEvent.accepted: bool#

Specifies if the mouse event has been accepted

Access functions:
property PᅟySide6.Qt3DInput.Qt3DInput.QMouseEvent.button: Buttons#

Specifies the button triggering the mouse event

Access functions:
property PᅟySide6.Qt3DInput.Qt3DInput.QMouseEvent.buttons: int#

Specifies the button triggering the mouse event

Access functions:
property PᅟySide6.Qt3DInput.Qt3DInput.QMouseEvent.modifiers: Modifiers#

Specifies if any modifiers were applied to the mouse event

Access functions:
property PᅟySide6.Qt3DInput.Qt3DInput.QMouseEvent.wasHeld: bool#

Specifies if a mouse button was held down during the mouse event

Access functions:
property PᅟySide6.Qt3DInput.Qt3DInput.QMouseEvent.x: int#

Specifies The X coordinate of the mouse event

Access functions:
  • x ()

property PᅟySide6.Qt3DInput.Qt3DInput.QMouseEvent.y: int#

Specifies The y coordinate of the mouse event

Access functions:
  • y ()

PySide6.Qt3DInput.Qt3DInput.QMouseEvent.Buttons#

Constant

Description

Qt3DInput.QMouseEvent.LeftButton

Qt3DInput.QMouseEvent.RightButton

Qt3DInput.QMouseEvent.MiddleButton

Qt3DInput.QMouseEvent.BackButton

Qt3DInput.QMouseEvent.NoButton

PySide6.Qt3DInput.Qt3DInput.QMouseEvent.Modifiers#

Constant

Description

Qt3DInput.QMouseEvent.NoModifier

Qt3DInput.QMouseEvent.ShiftModifier

Qt3DInput.QMouseEvent.ControlModifier

Qt3DInput.QMouseEvent.AltModifier

Qt3DInput.QMouseEvent.MetaModifier

Qt3DInput.QMouseEvent.KeypadModifier

PySide6.Qt3DInput.Qt3DInput.QMouseEvent.button()#
Return type:

Buttons

Returns the mouse button of the mouse event.

Getter of property button .

PySide6.Qt3DInput.Qt3DInput.QMouseEvent.buttons()#
Return type:

int

Returns a bitfield to be used to check for mouse buttons that may be accompanying the mouse event.

Getter of property buttons .

PySide6.Qt3DInput.Qt3DInput.QMouseEvent.isAccepted()#
Return type:

bool

Returns whether the event was accepted.

Getter of property accepted .

PySide6.Qt3DInput.Qt3DInput.QMouseEvent.modifiers()#
Return type:

Modifiers

Returns the keyboard modifiers that may be accompanying the mouse event.

Getter of property modifiers .

PySide6.Qt3DInput.Qt3DInput.QMouseEvent.setAccepted(accepted)#
Parameters:

accepted – bool

Sets the event as accepted if accepted is true.

Note

When an event is accepted, it will prevent further propagation to other listeners.

See also

isAccepted()

Setter of property accepted .

PySide6.Qt3DInput.Qt3DInput.QMouseEvent.type()#
Return type:

Type

Returns the QEvent::Type of the event.

PySide6.Qt3DInput.Qt3DInput.QMouseEvent.wasHeld()#
Return type:

bool

Getter of property wasHeld .

PySide6.Qt3DInput.Qt3DInput.QMouseEvent.x()#
Return type:

int

Returns the x position of the mouse event.

Getter of property x .

PySide6.Qt3DInput.Qt3DInput.QMouseEvent.y()#
Return type:

int

Returns the y position of the mouse event.

Getter of property y .