您的位置:首页 > 产品设计 > UI/UE

QT QPixmap:It is not safe to use Pixmaps outside the GUI thread

2016-02-29 14:05 519 查看
写了一个程序,用了python的threading模块新建了一个线程来做了一些显示调用。运行的时候报下面的错误:

QT QPixmap:It is not safe to use Pixmaps outside the GUI thread

百度了一下
Qt只允许主线程(也就是main函数在的那个线程)使用界面类,因为界面类不是线程安全的,不可重入,在多个线程中使用可能会出现问题,因此Qt不建议主界面线程外的线程使用图形类和调用图形类接口。否则有可能报错:<span style="font-family: 'Microsoft YaHei', SimHei, arial, 宋体; font-size: 15px;"><span style="color: rgb(255, 0, 0);">QT QPixmap:It is not safe to use Pixmaps outside the GUI thread</span> </span>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: