当图片比较大的时候,获取图像中像素信息的计算耗时可能会增加一点,Debug模式偶尔会从1ms->10ms不等,分辨率是1000万像素的图像,所以做了一个线程去处理。 问题:connect(&m_pixelwork,SIGNAL(PixelInfo(QImage::Format,QColor,int,int,int,int), this,SLOT(ShowPixel(QImage::Format,QColor,int,int,int,int))); m_pixelwork是工作类,线程通过moveToThread来运行,连接成功但是不进入槽函数。。。 从网上大神的博客了解到需要用到QueuedConnection http://www.cnblogs.com/findumars/p/5176419.html 因此默认的方式Auto没有设置成Queue模式,所以改成如下: qRegisterMetaType<QImage::Format>("QImage::Format"); 改成Queued之后需要对QImage::Format进行注册 |
|