PDA

View Full Version : (QT4.2-RC1) QGraphicsScene QGraphicsView QGraphicsItem



antonio.r.tome
20th September 2006, 10:53
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é

wysota
20th September 2006, 10:56
Yes. Modify the depth using setZValue().