class QPickEvent#

The QPickEvent class holds information when an object is picked. More

Inheritance diagram of PySide6.Qt3DRender.Qt3DRender.QPickEvent

Inherited by: QPickTriangleEvent, QPickPointEvent, QPickLineEvent

Synopsis#

Properties#

Methods#

Slots#

Signals#

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#

This is received as a parameter in most of the QObjectPicker component signals when picking succeeds.

See also

QPickingSettings QPickTriangleEvent QObjectPicker

class Buttons#

Constant

Description

Qt3DRender.QPickEvent.LeftButton

Qt3DRender.QPickEvent.RightButton

Qt3DRender.QPickEvent.MiddleButton

Qt3DRender.QPickEvent.BackButton

Qt3DRender.QPickEvent.NoButton

class Modifiers#

Constant

Description

Qt3DRender.QPickEvent.NoModifier

Qt3DRender.QPickEvent.ShiftModifier

Qt3DRender.QPickEvent.ControlModifier

Qt3DRender.QPickEvent.AltModifier

Qt3DRender.QPickEvent.MetaModifier

Qt3DRender.QPickEvent.KeypadModifier

Note

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

property acceptedᅟ: bool#

Specifies if event has been accepted

Access functions:
property buttonᅟ: Qt3DRender.QPickEvent.Buttons#

Specifies mouse button that caused the event

Access functions:
property buttonsᅟ: int#

Specifies state of the mouse buttons for the event

Access functions:
property distanceᅟ: float#

Specifies the distance of the hit to the camera

Access functions:
property entityᅟ: QEntity#

The entity that the picked geometry belongs to.

If the object picker is not attached to a leaf node in the scene graph, this is useful to find which child entity was actually picked.

Access functions:
property localIntersectionᅟ: QVector3D#

Specifies the coordinates of the hit in the local coordinate system of the picked entity

Access functions:
property modifiersᅟ: int#

Specifies state of the mouse buttons for the event

Access functions:
property positionᅟ: QPointF#

Specifies the mouse position with respect to the render area (window or quick item)

Access functions:
property viewportᅟ: QViewport#

The viewport in which this event originated. A null value means the event originated from a frame graph branch without a QViewport . If a frame graph branch has a Viewport inside a Viewport the property will contain the leaf viewport.

Access functions:
property worldIntersectionᅟ: QVector3D#

Specifies the coordinates of the hit in world coordinate system

Access functions:
__init__()#

Constructs a new QPickEvent .

__init__(position, worldIntersection, localIntersection, distance)
Parameters:

Constructs a new QPickEvent with the given parameters: position, intersection, localIntersection and distance

__init__(position, worldIntersection, localIntersection, distance, button, buttons, modifiers)
Parameters:
  • positionQPointF

  • worldIntersectionQVector3D

  • localIntersectionQVector3D

  • distance – float

  • buttonButtons

  • buttons – int

  • modifiers – int

Constructs a new QPickEvent with the given parameters: position, worldIntersection, localIntersection, distance, button, buttons and modifiers

acceptedChanged(accepted)#
Parameters:

accepted – bool

Notification signal of property acceptedᅟ .

button()#
Return type:

Buttons

QPickEvent::button Returns mouse button that caused the event

Getter of property buttonᅟ .

buttons()#
Return type:

int

QPickEvent::buttons Returns bitfield to be used to check for mouse buttons that may be accompanying the pick event.

Getter of property buttonsᅟ .

distance()#
Return type:

float

QPickEvent::distance Returns distance from camera to pick point

Getter of property distanceᅟ .

entity()#
Return type:

QEntity

Getter of property entityᅟ .

isAccepted()#
Return type:

bool

QPickEvent::isAccepted Returns true if the event has been accepted

Getter of property acceptedᅟ .

localIntersection()#
Return type:

QVector3D

QPickEvent::localIntersection Returns coordinates of the hit in the local coordinate system of the picked entity

Getter of property localIntersectionᅟ .

modifiers()#
Return type:

int

QPickEvent::modifiers Returns bitfield to be used to check for keyboard modifiers that may be accompanying the pick event.

Getter of property modifiersᅟ .

position()#
Return type:

QPointF

QPickEvent::position Returns mouse pointer coordinate of the pick query

Getter of property positionᅟ .

setAccepted(accepted)#
Parameters:

accepted – bool

QPickEvent::setAccepted set if the event has been accepted to accepted

See also

isAccepted()

Setter of property acceptedᅟ .

viewport()#
Return type:

QViewport

Getter of property viewportᅟ .

worldIntersection()#
Return type:

QVector3D

QPickEvent::worldIntersection Returns coordinates of the hit in world coordinate system

Getter of property worldIntersectionᅟ .