QPickEvent Class

class Qt3DRender::QPickEvent

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

Header: #include <QPickEvent>
qmake: QT += 3drender
Since: Qt 5.7
Instantiated By: PickEvent
Inherits: QObject
Inherited By:

Qt3DRender::QPickLineEvent, Qt3DRender::QPickPointEvent, and Qt3DRender::QPickTriangleEvent

This class was introduced in Qt 5.7.

Public Types

enum Buttons { LeftButton, RightButton, MiddleButton, BackButton, NoButton }
enum Modifiers { NoModifier, ShiftModifier, ControlModifier, AltModifier, MetaModifier, KeypadModifier }

Properties

Public Functions

Qt3DRender::QPickEvent::Buttons button() const
int buttons() const
float distance() const
Qt3DCore::QEntity *entity() const
bool isAccepted() const
QVector3D localIntersection() const
int modifiers() const
QPointF position() const
Qt3DRender::QViewport *viewport() const
QVector3D worldIntersection() const

Public Slots

void setAccepted(bool accepted)

Signals

void acceptedChanged(bool accepted)

Detailed Description

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

See also QPickingSettings, QPickTriangleEvent, and QObjectPicker.

Member Type Documentation

enum QPickEvent::Buttons

ConstantValue
Qt3DRender::QPickEvent::LeftButtonQt::LeftButton
Qt3DRender::QPickEvent::RightButtonQt::RightButton
Qt3DRender::QPickEvent::MiddleButtonQt::MiddleButton
Qt3DRender::QPickEvent::BackButtonQt::BackButton
Qt3DRender::QPickEvent::NoButtonQt::NoButton

enum QPickEvent::Modifiers

ConstantValue
Qt3DRender::QPickEvent::NoModifierQt::NoModifier
Qt3DRender::QPickEvent::ShiftModifierQt::ShiftModifier
Qt3DRender::QPickEvent::ControlModifierQt::ControlModifier
Qt3DRender::QPickEvent::AltModifierQt::AltModifier
Qt3DRender::QPickEvent::MetaModifierQt::MetaModifier
Qt3DRender::QPickEvent::KeypadModifierQt::KeypadModifier

Property Documentation

accepted : bool

Specifies if event has been accepted

Access functions:

bool isAccepted() const
void setAccepted(bool accepted)

Notifier signal:

void acceptedChanged(bool accepted)

button : const Qt3DRender::QPickEvent::Buttons

Specifies mouse button that caused the event

Access functions:

Qt3DRender::QPickEvent::Buttons button() const

buttons : const int

Specifies state of the mouse buttons for the event

Access functions:

int buttons() const

distance : const float

Specifies the distance of the hit to the camera

Access functions:

float distance() const

entity : Qt3DCore::QEntity* const

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.

This property was introduced in Qt 5.14.

Access functions:

Qt3DCore::QEntity *entity() const

localIntersection : const QVector3D

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

Access functions:

QVector3D localIntersection() const

modifiers : const int

Specifies state of the mouse buttons for the event

Access functions:

int modifiers() const

position : const QPointF

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

Access functions:

QPointF position() const

viewport : Qt3DRender::QViewport* const

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.

This property was introduced in Qt 5.14.

Access functions:

Qt3DRender::QViewport *viewport() const

worldIntersection : const QVector3D

Specifies the coordinates of the hit in world coordinate system

Access functions:

QVector3D worldIntersection() const