执行3D常将中实体的pick操作,结果出现了编译错误:invalid application of 'sizeof' to incomplete type 'Qt3DRender::QPickEvent'

QT编译错误:invalid application of 'sizeof' to incomplete type 'Qt3DRender::QPickEvent'-LMLPHP

QT编译错误:invalid application of 'sizeof' to incomplete type 'Qt3DRender::QPickEvent'-LMLPHP

Qt3DRender::QObjectPicker *picker = new Qt3DRender::QObjectPicker(m_sphereEntity);
picker->setHoverEnabled(true);
picker->setEnabled(true);
connect(picker, &Qt3DRender::QObjectPicker::clicked, this, &SceneModifier::mouseClicked);  //出错行

槽函数原型:void mouseClicked(Qt3DRender::QPickEvent *evt

尝试来尝试去,结果是头文件没有包含,包含头文件即可!

#include <QPickEvent>
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.
05-11 10:49