The QPickEvent class holds information when an object is picked. 更多...
头: | #include <QPickEvent> |
CMake: |
find_package(Qt6 REQUIRED COMPONENTS 3drender)
target_link_libraries(mytarget PRIVATE Qt6::3drender) |
qmake: | QT += 3drender |
实例化: | PickEvent |
继承: | QObject |
继承者: | Qt3DRender::QPickLineEvent , Qt3DRender::QPickPointEvent ,和 Qt3DRender::QPickTriangleEvent |
enum | Buttons { LeftButton, RightButton, MiddleButton, BackButton, NoButton } |
enum | Modifiers { NoModifier, ShiftModifier, ControlModifier, AltModifier, MetaModifier, KeypadModifier } |
|
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 , Qt3DRender::QPickEvent::Buttons button , int buttons , int modifiers ) | |
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 |
void | setAccepted (bool accepted ) |
void | acceptedChanged (bool accepted ) |
This is received as a parameter in most of the QObjectPicker component signals when picking succeeds.
另请参阅 QPickingSettings , QPickTriangleEvent ,和 QObjectPicker .
常量 | 值 |
---|---|
Qt3DRender::QPickEvent::LeftButton
|
Qt::LeftButton
|
Qt3DRender::QPickEvent::RightButton
|
Qt::RightButton
|
Qt3DRender::QPickEvent::MiddleButton
|
Qt::MiddleButton
|
Qt3DRender::QPickEvent::BackButton
|
Qt::BackButton
|
Qt3DRender::QPickEvent::NoButton
|
Qt::NoButton
|
常量 | 值 |
---|---|
Qt3DRender::QPickEvent::NoModifier
|
Qt::NoModifier
|
Qt3DRender::QPickEvent::ShiftModifier
|
Qt::ShiftModifier
|
Qt3DRender::QPickEvent::ControlModifier
|
Qt::ControlModifier
|
Qt3DRender::QPickEvent::AltModifier
|
Qt::AltModifier
|
Qt3DRender::QPickEvent::MetaModifier
|
Qt::MetaModifier
|
Qt3DRender::QPickEvent::KeypadModifier
|
Qt::KeypadModifier
|
Specifies if event has been accepted
访问函数:
bool | isAccepted () const |
void | setAccepted (bool accepted ) |
通知程序信号:
void | acceptedChanged (bool accepted ) |
[read-only]
button
: const
Qt3DRender::QPickEvent::Buttons
Specifies mouse button that caused the event
访问函数:
Qt3DRender::QPickEvent::Buttons | button () const |
[read-only]
buttons
: const
int
Specifies state of the mouse buttons for the event
访问函数:
int | buttons () const |
[read-only]
distance
: const
float
Specifies the distance of the hit to the camera
访问函数:
float | distance () const |
[read-only]
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.
访问函数:
Qt3DCore::QEntity * | entity () const |
[read-only]
localIntersection
: const
QVector3D
Specifies the coordinates of the hit in the local coordinate system of the picked entity
访问函数:
QVector3D | localIntersection () const |
[read-only]
modifiers
: const
int
Specifies state of the mouse buttons for the event
访问函数:
int | modifiers () const |
[read-only]
position
: const
QPointF
Specifies the mouse position with respect to the render area (window or quick item)
访问函数:
QPointF | position () const |
[read-only]
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.
访问函数:
Qt3DRender::QViewport * | viewport () const |
[read-only]
worldIntersection
: const
QVector3D
Specifies the coordinates of the hit in world coordinate system
访问函数:
QVector3D | worldIntersection () const |
Constructs a new QPickEvent.
Constructs a new QPickEvent with the given parameters: position , intersection , localIntersection and distance
Constructs a new QPickEvent with the given parameters: position , worldIntersection , localIntersection , distance , button , buttons and modifiers
QPickEvent::button Returns mouse button that caused the event
注意: Getter function for property button.
QPickEvent::buttons Returns bitfield to be used to check for mouse buttons that may be accompanying the pick event.
注意: Getter function for property buttons.
QPickEvent::distance Returns distance from camera to pick point
注意: Getter function for property distance.
QPickEvent::isAccepted Returns true if the event has been accepted
注意: getter 函数对于特性 accepted .
QPickEvent::localIntersection Returns coordinates of the hit in the local coordinate system of the picked entity
注意: Getter function for property localIntersection.
QPickEvent::modifiers Returns bitfield to be used to check for keyboard modifiers that may be accompanying the pick event.
注意: Getter function for property modifiers.
QPickEvent::position Returns mouse pointer coordinate of the pick query
注意: getter 函数对于特性 position。
[slot]
void
QPickEvent::
setAccepted
(
bool
accepted
)
QPickEvent::setAccepted set if the event has been accepted to accepted
注意: setter 函数对于特性 accepted .
另请参阅 isAccepted ().
QPickEvent::worldIntersection Returns coordinates of the hit in world coordinate system
注意: Getter function for property worldIntersection.