当前位置:网站首页>qt pass custom structure parameters in different threads
qt pass custom structure parameters in different threads
2022-07-31 09:02:00 【come on, dude】
If the functions of the qt program are all in the main thread, the custom structure can be passed.
eg
struct Student{QString name;int ID;}//Assume from form a to form b, all in the main threadconnect(a,&A::sSendStudent,b,&B::receiverStudent);//This can be passed.
But when different threads can not pass.
This problem occurs
QObject::connect: Cannot queuearguments of type 'Student'
Solution
Include in the file that sends the signal
#include
Then add in the constructor:
qRegisterMetaType<Student>("Student");
For the record only.
边栏推荐
猜你喜欢
随机推荐
How to restore data using mysql binlog
MySQL 日期时间类型精确到毫秒
Small application project development, jingdong mall 】 【 uni - app custom search component (below) - search history
安装gnome-screenshot截图工具
JSP session的生命周期简介说明
搭建frp进行内网穿透
编译器R8问题Multidex
MySQL中InnoDB的多版本并发控制(MVCC)的实现
2019 NeurIPS | Graph Convolutional Policy Network for Goal-Directed Molecular Graph Generation
科目三:前方路口直行
matlab常用符号用法总结
【MySQL功法】第2话 · 数据库与数据表的基本操作
奉劝那些刚参加工作的学弟学妹们:要想进大厂,这些核心技能是你必须要掌握的!完整学习路线!
JSP application对象简介说明
【小程序项目开发-- 京东商城】uni-app之商品列表页面 (上)
六、MFC文档类(单文档和多文档)
【黄啊码】MySQL入门—3、我用select ,老板直接赶我坐火车回家去,买的还是站票
怎样修改MySQL数据库的密码
【Unity】编辑器扩展-04-拓展Scene视图
蚂蚁核心科技产品亮相数字中国建设峰会 持续助力企业数字化转型