• 5683阅读
  • 3回复

[提问]QPixmap: It is not safe to use pixmaps outside the GUI thread [复制链接]

上一主题 下一主题
离线368229767
 
只看楼主 倒序阅读 楼主  发表于: 2012-05-15
急求
QPixmap: It is not safe to use pixmaps outside the GUI thread
的解决方法!
附件是在Qt个人展示区下载的,基于C/S的远程控制基于C/S的远程控制来自baskerle Control3.0.rar (5620 K) 下载次数:1
希望各位大神帮帮忙解决下。
在客户端不能显示服务器的桌面!
很急!
基于C/S的远程控制来自baskerle Control3.0.rar (5620 K) 下载次数:1
离线ppdayz

只看该作者 1楼 发表于: 2012-05-15
回 楼主(368229767) 的帖子
        In GUI applications, the main thread is also called the GUI thread because it's the only thread that is allowed to perform GUI-related operations.
And the class QThread is non-Gui  thread,so you cann`t  use the GUI class Qpixmap in it.
这个是qt定的,所以没有办法解决
ps,虽然不能使用Qpixmap ,但可以使用QImage,如有需要可以在线程外面将QImage转换成QPixmap
离线368229767
只看该作者 2楼 发表于: 2012-05-15
回 1楼(ppdayz) 的帖子
可是如何在子线程中用QImage获取屏幕的截屏呢?
离线368229767
只看该作者 3楼 发表于: 2012-05-15
回 1楼(ppdayz) 的帖子
我看了很多资料说是可以向GUI线程发送一个信号,直接把子线程的数据发送过去
但是一直解决不了!
快速回复
限100 字节
 
上一个 下一个