QList 无法从XXX * 转化为 const Plane &

weixin_38048553 2019-09-19 04:18:10
Plane *plane = new Plane;        scene->addItem(plane);        plane->setPos(0,0);        listPlaneAir->append(plane);PlaneNew *plane1=new PlaneNew;        plane1->setPos(-200,200);        scene->addItem(plane1);        listPlaneLand->append(plane1);        connect(this,SIGNAL(valueChanged(int)),listPlaneAir->first(),SLOT(setSpeed(int)));        connect(this,SIGNAL(valueChanged(int)),listPlaneLand->first(),SLOT(setSpeed(int)));报错1>.\airport.cpp(28) : error C2664: 'QList<T>::append' : cannot convert parameter 1 from 'Plane *' to 'const Plane &'1>.\airport.cpp(33) : error C2664: 'QList<T>::append' : cannot convert parameter 1 from 'PlaneNew *' to 'const PlaneNew &'1>.\airport.cpp(35) : error C2664: 'bool QObject::connect(const QObject *,const char *,const QObject *,const char *,Qt::ConnectionType)' : cannot convert parameter 3 from 'Plane' to 'const QObject *'1>.\airport.cpp(36) : error C2664: 'bool QObject::connect(const QObject *,const char *,const QObject *,const char *,Qt::ConnectionType)' : cannot convert parameter 3 from 'PlaneNew' to 'const QObject *'其中listPlaneAir为QList<Plane>listPlaneLand为QList<PlaneNew>
...全文
41 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复

435

社区成员

发帖
与我相关
我的任务
社区描述
其他技术讨论专区
其他 技术论坛(原bbs)
社区管理员
  • 其他技术讨论专区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧