[英]Perform deep copy over QImage
How to perform a deep copy on a QImage?如何在 QImage 上执行深拷贝?
What I have is like this:我所拥有的是这样的:
texture_img = camWorker->getImage();
QImage CamWorker::getImage(){
QMutexLocker locker(&mutex);
return QImg;
}
and the QImg is from a stream Video.并且 QImg 来自流视频。 However I found that the texture_img = camWorker->getImage();
但是我发现texture_img = camWorker->getImage();
only performs a shallow copy over QImage, and when the QImg is changed in another thread it creates seg-fault.仅在 QImage 上执行浅拷贝,当 QImg 在另一个线程中更改时,它会创建段错误。 Will a deepcopy solve the problem?深度拷贝会解决问题吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.