QPixmap: It is not safe to use pixmaps outside the GUI thread
今天遇到这个问题
程序是次线程处理完数据后,发射一个信号给主线程,显示更新图片,然后提示QPixmap: It is not safe to use pixmaps outside the GUI thread
提示这个错误的时候两个线程之间的信号槽连接属性是Qt::DirectConnection,会提示不是在GUI线程里
后面属性改为默认的,不写,就不会出现这个问题了。
关键还是看连接属性的具体说明:
Qt::AutoConnection 0 (default) If the signal is emitted from a different thread than the receiving object, the signal is queued, behaving as Qt::QueuedConnection. Otherwise, the slot is invoked directly, behaving as Qt::DirectConnection. The type of connection is determined when the signal is emitted.
Qt::DirectConnection 1 The slot is invoked immediately, when the signal is emitted.
Qt::QueuedConnection 2 The slot is invoked when control returns to the event loop of the receiver's thread. The slot is executed in the receiver's thread.
QPixmap: It is not safe to use pixmaps outside the GUI thread相关推荐
- QPixmap: It is not safe to use pixmaps outside the GUI thread原因
Qt只允许主线程使用界面类,因为界面类不是线程安全的,不可重入,在多个线程中使用可能会出现问题,因此Qt不建议主界面线程外的线程使用图形类和调用图形类接口.建议你修改最初的设计,让界面与控制分离,主线 ...
- mysql thread safe_Windows环境下完全手工配置Apache、MySQL和PHP(Thread Safe)
happydagui:现在LAMP(Linux.Apache.MySQL.PHP/Perl/Python的简称)已经很流行了.在Windows下也有类似的,比如 WAMP(Apache, MySQL, ...
- php5.6non thread safe 区别,PHP版本Non Thread Safe和Thread Safe如何选择?区别是什么?
PHP版本分为Non Thread Safe和Thread Safe,Non Thread Safe是指非线程安全,Thread Safe是指线程安全,区别是什么?如何选择? Non Thread S ...
- c语言程序设计樱花,Qt实现樱花飞舞效果
本文实例为大家分享了Qt实现樱花飞舞效果的具体代码,供大家参考,具体内容如下 应女友要求,使用Qt做了一个在电脑桌面樱花飞舞的小程序.这里面用到了Qt动画效果QPropertyAnimation类来控 ...
- 用C#去除代码的SourceSafe管理
经常看一些的程序,有些一个解决方案带有多个项目,由于代码比较多,多人开发,所以好多vs.net下的工程是用source safe进行版本控制的.而用source safe进行版本控制需要局域网路径共享 ...
- thrift使用小记_CUDev-ChinaUnix博客
thrift使用小记_CUDev-ChinaUnix博客 thrift使用小记 (2011-09-19 21:28) 标签: 客户端 接口 Facebook transport protoc ...
- PPP interface for lwIP
//原文 地址 :http://www.nongnu.org/lwip/2_0_x/group__ppp.html /* //协议说明,2017年6月29日14:19:18,suozhangPPP i ...
- IIS8 使用FastCGI配置PHP环境支持 过程详解
平时帮朋友们配置过一些PHP环境的服务器,但是一直使用的都是Apache HTTP+PHP,今天呢,我吧IIS+PHP配置方式给大家发一下下~呵呵. 在这里,我使用的是FastCGI模块映射的方式配置 ...
- PHP----------线程安全和非线程安全的介绍
1.Linux下的PHP,没有线程安全版和非线程安全版之分.从2000年10月20日发布的第一个Windows版的PHP3.0.17开始的都是线程安全的版本,直至5.2.1版本开始有Thread Sa ...
最新文章
- 微信小程序去掉左上角的返回箭头
- Ubuntu创建opencv工程并显示一张图片
- Qt读写注册表和ini文件
- arcgis 圈选获取图层下点位_ArcGIS小技巧——提取面要素的质心点
- hadoop--历史服务器配置
- python 调用opencv dll_【问题已解决】python 3.6下安装opencv-python解决cv2 DLL load failed: 找不到指定的模块问题...
- 数据通过蓝牙传输中...70.46k/s
- Oracle回收站使用全攻略
- PMP证书考试试题有多少
- 基于MATLAB的疲劳检测系统研究解析
- 状态压缩dp学习小记part1
- 无线射频专题《IEEE 802.11协议讲解1@路由高级配置项,Beacon周期、RTS阈值、DTIM》
- ObjectMapper使用详细介绍
- 软件测试人员需不需要懂代码
- Codeforces 950C Zebras ( 贪心 模拟 )
- 删除linux系统 mbr,Windows 10 下安全删除 Linux 系统
- new relic_Datadog,SignalFX,New Relic,Wavefront –您应该选择哪个仪表板?
- 云宏广东省中医院虚拟化管理平台
- OSG3.6.3_X64_Collada Dae插件VS2017详细编译步骤
- iOS开发 ---- 其他控件,弹窗,滑块,菊花,步进,分段等