使用两个 QPainter 实例同时在 QImage 上绘图
我正在 PyQt4 中开发一个应用程序。
在我的应用程序中,我需要根据两个来源的数据绘制 QImage
(例如,想象一下定期调用的不规则定时方法来编辑图像)
为此,我需要使用 QPainter 的两个实例来编辑 QImage,并且两个实例可能同时处理图像。
如果没有特殊处理,这能正常工作吗?
如果不是,我必须采取哪些额外措施来确保所有同时编辑顺利进行而不会丢失?
I am working on an application in PyQt4.
In my application I will need to draw on a QImage according to data from two sources
(for example, imagine periodically-called irregularly-timed methods which edit the image)
For this I'll need to edit the QImage using two instances of QPainter, and both might be working on the image simultaneously.
Will this work fine without special handling?
If no, what are the additional measures I must take to ensure that all the simultaneous edits happen smoothly without loss?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
引用 QPainter::begin() 的文档:
因此,您需要将绘画同步到该图像。
To quote the docs for QPainter::begin():
So you would need to synchronize painting to that image.