QObject::connect: Cannot queue arguments of type 'XXX'
来源:互联网 发布:阿里云建ss 编辑:程序博客网 时间:2024/06/05 16:21
1 开发环境
Win10(64bit)
Qt5.4.2(64bit)
2 错误描述
在不同线程之间通过信号/槽来传递自定义数据类型QList<RootNode>的时候,提示错误:
QObject::connect: Cannot queue arguments of type 'QList<RootNode>'(Make sure 'QList<RootNode>' is registered using qRegisterMetaType().)在同一个线程中传递上述类型是没有错误的。
3 解决方法
根据参考资料[1]的提示,先包含头文件:
#include <QMetaType>然后注册自定义类:
qRegisterMetaType<QList<RootNode>>("QList<RootNode>");注意:其实自定义的类型只是RootNode而已,QList是Qt自带的类型。由于信号/槽中使用到const QList<RootNode>&类型的参数,因此需要注销QList<RootNode>类型!
参考资料
[1]QObject::connect: Cannot queue arguments of type "xxx",(Make sure "xxx" is registed using qRegisterMetaType().)原因及解决方法
0 0
- QObject::connect: Cannot queue arguments of type 'XXX'
- Qt: QObject::connect: Cannot queue arguments of type 'XXX'
- QObject::connect: Cannot queue arguments of type
- QObject::connect: Cannot queue arguments of type "xxx",(Make sure "xxx" is registed using qRegisterM
- [Qt]QObject::connect: Cannot queue arguments of type 'QString&'
- 关于QObject::connect: Cannot queue arguments of type"..."
- 关于QObject::connect: Cannot queue arguments of type"..."
- QObject::connect: Cannot queue arguments of type 'cv::Mat'
- QObject::connect: Cannot queue arguments of type 'string'
- QObject::connect: Cannot queue arguments of type 'QList<QMap<QString,QString> >'
- 信号槽传递非Qt库类型参数时,出现QObject::connect: Cannot queue arguments of type 'QUuid'(Make sure 'string' is regi
- Qt:QtQuick Cannot queue arguments of type 'QQmlChangeSet'
- QObject::connect: No such slot xxx错误
- QObject::connect: No such slot xxx错误
- 有关 flex.messaging.MessageException: Cannot create class of type 'XXX'. Type 'XXX' not found.
- Cannot infer type arguments for PageImpl<>
- g++编译报错原因分析cannot allocate an object of abstract type“XXX ”
- Cannot convert value of type [java.lang.String] to required type [java.util.Date] for property 'xxx'
- cf#301-D - Bad Luck Island-概率dp(水 )
- light7ui 刷新子页面 js不能加载的问题
- java内置数据类型
- Android gallery+BaseAdapter实现简易的图片查看器
- C++设计模式<一>:简介
- QObject::connect: Cannot queue arguments of type 'XXX'
- 第一个ios程序中的问题
- 【AJAX】$.get()方法补充知识
- memcached 命令行参数说明
- Android Studio使用记录
- 自定义控件H之——聊天ListView
- Hadoop 2.5.2 安装
- 关于android系统编译
- Android开发 图片轮播条Lanner(可无限滚动循环,自定义dots样式位置,延迟时间,滚动时间,点击事件)