Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在开发 PyQt4 中的应用程序。
在我的应用程序中,我需要根据来自两个来源的数据绘制 QImage (例如,想象定期调用的不规则定时方法来编辑图像)
为此,我需要使用 QPainter 的两个实例来编辑 QImage,并且两者可能同时在图像上工作。
如果没有特殊处理,这可以正常工作吗? 如果不是,我必须采取哪些额外措施来确保所有同时编辑顺利进行而不会丢失?
引用QPainter::begin()的文档:
警告:油漆设备一次只能由一名油漆工进行油漆。
因此,您需要将绘画与该图像同步。