PDA

View Full Version : QGraphicsScene - order of images drawn



bjh
29th November 2007, 15:59
Hi All,

How can I control the order in which different objects are drawn? I've set my scene setBackgroundBrush to an image; now I need to draw a set of lines "on top" of the background, then an object "on top" of the lines. My object is drawn "under" the lines.

I realize that the lines are being drawn after the object is drawn. How can I change the order in which these are drawn? :confused:

Thanks for any guidance on this! I'm using Qt4.2


bjh

jacek
29th November 2007, 16:09
This order is controlled by QGraphicsItem::zValue().

bjh
29th November 2007, 16:41
Thanks jacek - that did the trick for me. I need to think in 3D! :) Your assistance is very much appreciated!


bjh