Results 1 to 2 of 2

Thread: (QT4.2-RC1) QGraphicsScene QGraphicsView QGraphicsItem

  1. #1
    Join Date
    Feb 2006
    Location
    Portugal
    Posts
    24
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question (QT4.2-RC1) QGraphicsScene QGraphicsView QGraphicsItem

    Hi,

    I'm testing the new qt4.2-Rc1.
    I've three QPainterPath
    one is a set of horizontal lines, other is a set of vertical lines both made with Path.moveTo();
    Path.lineTo() and the last one is
    a square made with Path.addRect().
    Then I put this three QPainterPath's on a QGraphicsScene
    using
    QGraphicsItem *path = scene.addPath(PainterPath,Pen,brush);
    the brush for the first two painter paths is Qt::NoBrush
    and for the third (the square) is Qt::SolidPattern

    this third PainterPath is the last one to the added to scene.

    I was expecting that the square was in top of the lines (the lines shouldn't be seen inside the square), and sometimes that is what happens other times not (with the same binaries, different runs) as if the order of adding the QGraphicsItem's to the scene was random and changed in every run.

    am I missing someting? Is there some depth atributte to itens tha I'm missing??

    My best regards,

    António Tomé

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: (QT4.2-RC1) QGraphicsScene QGraphicsView QGraphicsItem

    Yes. Modify the depth using setZValue().

  3. The following 2 users say thank you to wysota for this useful post:

    antonio.r.tome (20th September 2006), Zatraz (21st September 2006)

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.