QT编译错误:invalid application of 'sizeof' to incomplete type 'Qt3DRender::QPickEvent'
执行3D常将中实体的pick操作,结果出现了编译错误:invalid application of 'sizeof' to incomplete type 'Qt3DRender::QPickEvent'
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.
希望大家能把自己的所学和他人一起分享,不要去鄙视别人索取时的贪婪,因为最应该被鄙视的是不肯分享时的吝啬。