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.

posted on 2019-01-23 14:19  我来乔23  阅读(773)  评论(0编辑  收藏  举报

导航