Results 1 to 3 of 3

Thread: QGraphicsScene - order of images drawn

  1. #1
    Join Date
    Sep 2007
    Posts
    14
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QGraphicsScene - order of images drawn

    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?

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


    bjh

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QGraphicsScene - order of images drawn

    This order is controlled by QGraphicsItem::zValue().

  3. The following user says thank you to jacek for this useful post:

    bjh (29th November 2007)

  4. #3
    Join Date
    Sep 2007
    Posts
    14
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QGraphicsScene - order of images drawn

    Thanks jacek - that did the trick for me. I need to think in 3D! Your assistance is very much appreciated!


    bjh

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.