关于QObject::connect: Cannot queue arguments of type"..."

来源:互联网 发布:mac怎么写入移动硬盘 编辑:程序博客网 时间:2024/06/13 21:52

输出窗口报的是
QObject::connect: Cannot queue arguments of type 's_MSGBoxInfo'

(Make sure 's_MSGBoxInfo' is registed using qRegisterMetaType().)

网上搜了一下相关的解决办法:connect时添加参数Qt::DirectConnection,以保证其不被放入信号队列,从而达到想要的效果,但这种办法不一定能解决该问题,因为QUuid类型是Qt的基本类型,是可以作为信号参数使用的,但此处却提示它并不能作为信号参数,所以根本问题不是Qt::DirectConnection所能解决的。


可在使用前注册该类型即可

qRegisterMetaType<s_MSGBoxInfo>("s_MSGBoxInfo");  

0 0
原创粉丝点击