开发者

How can I layer images in PyQt using QGraphicsScene and QGraphicsView

开发者 https://www.devze.com 2023-03-10 13:39 出处:网络
Let\'s say I have two images, image A and image B. Using QGraphicsScene and QGraphicsView, how can I draw image A to th开发者_JS百科e background, and layer image B on top of image A?

Let's say I have two images, image A and image B. Using QGraphicsScene and QGraphicsView, how can I draw image A to th开发者_JS百科e background, and layer image B on top of image A?

Thanks in advance.


If you have QGraphicsItems that you draw your images on you can use setZValue to set custom stack order.

If you only need background on the scene you can take advantage of scene layers, for example use backgroundBrush to change the background and then draw other things on top of that.

0

精彩评论

暂无评论...
验证码 换一张
取 消