Calvin
Calvin

Reputation: 11

How can I layer images in PyQt using QGraphicsScene and QGraphicsView

Let's say I have two images, image A and image B. Using QGraphicsScene and QGraphicsView, how can I draw image A to the background, and layer image B on top of image A?

Thanks in advance.

Upvotes: 1

Views: 2627

Answers (1)

Davor Lucic
Davor Lucic

Reputation: 29390

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.

Upvotes: 3

Related Questions