Results 1 to 2 of 2

Thread: goal: image always on top of polygone

  1. #1

    Default goal: image always on top of polygone


    I draw a polygone and an image onto a QGraphicsScene which is displayed using a QGraphicsView.
    I want the image to always be on top of the polygone. I guess this could be accomplished by always drawing the image after drawing the polygone (i draw repeatedly ever 30ms).
    However I would then have to remove my image, and draw it again, as this is what I do with the polygone. However this sounds bad. At the moment I simply use setPos() to move the image which is why the polygone is always (except for the very first time) on top.

    How can I make my image always appear on top of my polygone?

    Thanks for any advice.

  2. #2
    Join Date
    Apr 2010
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4

    Default Re: goal: image always on top of polygone

    GraphicsView/Scene/Item supports z-ordering. You have to explicitly set the layer your items are placed in; once placed, that's where they'll stay, and they will be draw from lowest to highest numbered layer. See the documentation for more details.

Similar Threads

  1. Image: out of memory, returning null image
    By darek_hecpl in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 22nd September 2010, 13:48
  2. Replies: 6
    Last Post: 21st September 2009, 10:55
  3. hide image,once moused moved from image
    By yuvaraj.yadav in forum Qt Programming
    Replies: 1
    Last Post: 22nd April 2009, 08:16
  4. How can we compare if one big image contains a small image?
    By learning_qt in forum Qt Programming
    Replies: 1
    Last Post: 13th March 2009, 09:20
  5. Replies: 3
    Last Post: 14th March 2007, 08:09


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.