ObjectPicker QML Type | Qt 3D 5.12.8

- Qt 5.12
- Qt 3D
- QML Types
- ObjectPicker QML Type
- Qt 5.12.8 Reference Documentation

# ObjectPicker QML Type

The ObjectPicker class instantiates a component that can be used to interact with an Entity by a process known as picking. More...

Import Statement: | import Qt3D.Render 2.12
Instantiates: | QObjectPicker

- List of all members, including inherited members

## Properties

- containsMouse : bool
- dragEnabled : bool
- hoverEnabled : bool
- pressed : bool

## Signals

- clicked(PickEvent pick)
- clicked(PickEvent pick)
- entered()
- exited()
- moved(PickEvent pick)
- pressed(PickEvent pick)
- released(PickEvent pick)

## Detailed Description

For every combination of viewport and camera, picking casts a ray through the scene to find entities who's bounding volume intersects the ray. The bounding volume is computed using the values in the attribute buffer specified by the boundingVolumePositionAttribute of the geometry.

The signals pressed(), released(), clicked(), moved(), entered(), and exited() are emitted when the bounding volume defined by the pickAttribute property intersects with a ray.

Most signals carry a PickEvent instance. If PickingSettings.pickMode is set to PickingSettings.TrianglePicking, the actual type of the pick parameter will be PickTriangleEvent.

Pick queries are performed on mouse press and mouse release. If drag is enabled, queries also happen on each mouse move while any button is pressed. If hover is enabled, queries happen on every mouse move even if no button is pressed.

Note: To receive hover events in QtQuick, the hoverEnabled property of Scene3D must also be set.

Note: Instances of this component shouldn't be shared, not respecting that condition will most likely result in undefined behavior.

See also PickingSettings, Geometry, Attribute, PickEvent, and PickTriangleEvent.

## Property Documentation

containsMouse : bool

Specifies if the object picker currently contains the mouse

dragEnabled : bool

hoverEnabled : bool

Specifies if hover is enabled

pressed : bool

Specifies if the object picker is currently pressed

## Signal Documentation

clicked(PickEvent pick)

This signal is emitted when the bounding volume defined by the pickAttribute property intersects with a ray on a mouse click the PickEvent pick contains details of the event.

clicked(PickEvent pick)

This signal is emitted when the bounding volume defined by the pickAttribute property intersects with a ray on a mouse click. Intersection information are accessible through the pick parameter.

entered()

This signal is emitted when the bounding volume defined by the pickAttribute property intersects with a ray on the mouse entering the volume.

exited()

This signal is emitted when the bounding volume defined by the pickAttribute property intersects with a ray on the ray exiting the volume.

moved(PickEvent pick)

This signal is emitted when the bounding volume defined by the pickAttribute property intersects with a ray on a mouse move with a button pressed. Intersection information are accessible through the pick parameter.

pressed(PickEvent pick)

This signal is emitted when the bounding volume defined by the pickAttribute property intersects with a ray on a mouse press. Intersection information are accessible through the pick parameter.

released(PickEvent pick)

This signal is emitted when the bounding volume defined by the pickAttribute property intersects with a ray on a mouse release. Intersection information are accessible through the pick parameter.