QObject::connect: Cannot queue arguments of type 'string'

来源:互联网 发布:linux普通用户提权 编辑:程序博客网 时间:2024/06/07 11:17

信号槽传递非Qt库类型参数时,出现QObject::connect: Cannot queue arguments of type 'string'(Make sure 'string' is regi...

例如以C++标准库中string做参数,则会出现:

QObject::connect: Cannot queue arguments of type 'string'

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


解决方案:

可以再main中加入:

qRegisterMetaType<string>("string");注册该类型


阅读全文
0 0
原创粉丝点击