首页 > 其他 > 详细

QT出现 Cannot create children for a parent that is in a different thread 的解决方法:

时间:2015-11-16 12:35:48      阅读:3518      评论:0      收藏:0      [点我收藏+]

timer = new Timer(this);改成 timer = new Timer();就可以了。

因为你timer是属于主线程的,尽量不要在非主线程里创建新的对象并指定其对象为主线程内的对象,否则QApplication.exec会warning.
this->exec(); 这样会显示的调用消息循环进而触发slot

 

QT出现 Cannot create children for a parent that is in a different thread 的解决方法:

原文:http://www.cnblogs.com/-wang-cheng/p/4968464.html

(1)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!