QPickEvent 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::QPickTriangleEvent

Public Types

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

Properties

  • 1 property inherited from QObject

Public Functions

QPickEvent()
QPickEvent(const QPointF &position, const QVector3D &intersection, const QVector3D &localIntersection, float distance)
QPickEvent(const QPointF &position, const QVector3D &worldIntersection, const QVector3D &localIntersection, float distance, Buttons button, int buttons, int modifiers)
Buttons button() const
int buttons() const
float distance() const
bool isAccepted() const
QVector3D localIntersection() const
int modifiers() const
QPointF position() const
QVector3D worldIntersection() const
  • 32 public functions inherited from QObject

Public Slots

void setAccepted(bool accepted)
  • 1 public slot inherited from QObject

Signals

void acceptedChanged(bool accepted)

Additional Inherited Members

  • 11 static public members inherited from QObject
  • 9 protected functions inherited from QObject

Detailed Description

The QPickEvent class holds information when an object is picked

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:

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

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

worldIntersection : const QVector3D

Specifies the coordinates of the hit in world coordinate system

Access functions:

QVector3D worldIntersection() const

Member Function Documentation

QPickEvent::QPickEvent()

Constructs a new QPickEvent.

QPickEvent::QPickEvent(const QPointF &position, const QVector3D &intersection, const QVector3D &localIntersection, float distance)

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

QPickEvent::QPickEvent(const QPointF &position, const QVector3D &worldIntersection, const QVector3D &localIntersection, float distance, Buttons button, int buttons, int modifiers)

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

Buttons QPickEvent::button() const

QPickEvent::button Returns mouse button that caused the event

Note: Getter function for property button.

int QPickEvent::buttons() const

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

Note: Getter function for property buttons.

float QPickEvent::distance() const

QPickEvent::distance Returns distance from camera to pick point

Note: Getter function for property distance.

bool QPickEvent::isAccepted() const

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

Note: Getter function for property accepted.

QVector3D QPickEvent::localIntersection() const

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

Note: Getter function for property localIntersection.

int QPickEvent::modifiers() const

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

Note: Getter function for property modifiers.

QPointF QPickEvent::position() const

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

Note: Getter function for property position.

[slot] void QPickEvent::setAccepted(bool accepted)

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

Note: Setter function for property accepted.

See also isAccepted().

QVector3D QPickEvent::worldIntersection() const

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

Note: Getter function for property worldIntersection.

© 2017 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.