Qt3DRender::QPickEvent Class
class Qt3DRender::QPickEventQPickEvent 类保存对象被拾取时的信息。更多
头文件: | #include <QPickEvent> |
CMake.QPickEvent | find_package(Qt6 REQUIRED COMPONENTS 3drender) target_link_libraries(mytarget PRIVATE Qt6::3drender) |
qmake: | QT += 3drender |
在 QML 中: | 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) |
详细说明
当拾取成功时,大多数QObjectPicker 组件信号都会将此作为参数接收。
另请参阅 QPickingSettings,QPickTriangleEvent, 和QObjectPicker 。
成员类型文档
enum QPickEvent::Buttons
常数 | 数值 |
---|---|
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 |
enum QPickEvent::Modifiers
常数 | 值 |
---|---|
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 |
属性文件
accepted : bool
指定事件是否已被接受
访问功能
bool | isAccepted() const |
void | setAccepted(bool accepted) |
通知信号
void | acceptedChanged(bool accepted) |
[read-only]
button : const Qt3DRender::QPickEvent::Buttons
指定导致事件发生的鼠标按钮
访问功能
Qt3DRender::QPickEvent::Buttons | button() const |
[read-only]
buttons : const int
为事件指定鼠标按钮的状态
访问功能:
int | buttons() const |
[read-only]
distance : const float
指定击中目标到摄像机的距离
访问功能:
float | distance() const |
[read-only]
entity : Qt3DCore::QEntity* const
拾取的几何体所属的实体。
如果对象拾取器未连接到场景图中的叶节点,则可用于查找实际拾取的是哪个子实体。
访问功能:
Qt3DCore::QEntity * | entity() const |
[read-only]
localIntersection : const QVector3D
指定命中点在被选中实体的本地坐标系中的坐标
访问功能:
QVector3D | localIntersection() const |
[read-only]
modifiers : const int
为事件指定鼠标按钮的状态
访问功能:
int | modifiers() const |
[read-only]
position : const QPointF
指定鼠标相对于呈现区域(窗口或快速项目)的位置
访问功能:
QPointF | position() const |
[read-only]
viewport : Qt3DRender::QViewport* const
事件发生的视口。空值表示事件来自一个没有QViewport 的框架图分支。如果框架图分支内部有一个视口,则该属性将包含叶视口。
访问函数:
Qt3DRender::QViewport * | viewport() const |
[read-only]
worldIntersection : const QVector3D
指定击中点在世界坐标系中的坐标
访问函数:
QVector3D | worldIntersection() const |
成员函数文档
QPickEvent::QPickEvent()
构造一个新的 QPickEvent。
QPickEvent::QPickEvent(const QPointF &position, const QVector3D &intersection, const QVector3D &localIntersection, float distance)
用给定的参数构造一个新的 QPickEvent:position,intersection,localIntersection 和distance
QPickEvent::QPickEvent(const QPointF &position, const QVector3D &worldIntersection, const QVector3D &localIntersection, float distance, Qt3DRender::QPickEvent::Buttons button, int buttons, int modifiers)
用给定的参数构造一个新的 QPickEvent:position,worldIntersection,localIntersection,distance,button,buttons 和modifiers
Qt3DRender::QPickEvent::Buttons QPickEvent::button() const
QPickEvent::button 返回引起事件的鼠标按钮
注: 属性按钮的获取函数。
int QPickEvent::buttons() const
QPickEvent::buttons 返回位字段,用于检查可能伴随拾取事件的鼠标按钮。
注: 属性按钮的获取函数。
float QPickEvent::distance() const
QPickEvent::distance 返回从摄像机到拾取点的距离
注: 属性 distance 的获取函数。
bool QPickEvent::isAccepted() const
QPickEvent::isAccepted 如果事件已被接受,则返回 true
注: 属性accepted 的获取函数。
QVector3D QPickEvent::localIntersection() const
QPickEvent::localIntersection 返回命中实体在本地坐标系中的坐标
注: localIntersection 属性的获取函数。
int QPickEvent::modifiers() const
QPickEvent::modifiers 返回位字段,用于检查可能伴随拾取事件的键盘修饰符。
注: 属性修改器的获取函数。
QPointF QPickEvent::position() const
QPickEvent::position 返回选取查询的鼠标指针坐标
注: 属性 position 的获取函数。
[slot]
void QPickEvent::setAccepted(bool accepted)
QPickEvent::setAccepted 设置事件是否已被接受。accepted
注: 属性accepted 的设置函数。
另请参阅 isAccepted() 。
QVector3D QPickEvent::worldIntersection() const
QPickEvent::worldIntersection 返回命中点在世界坐标系中的坐标。
注: 属性 worldIntersection 的获取函数。
© 2025 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.