[Qt-interest] QGraphicsItem and setZValue..how it works?

Riccardo Roasio riccardo.roasio at gmail.com
Mon Oct 19 11:26:21 CEST 2009


But there is a way to solve this problem?

Can i change the z value dinamically?

Thanks,
Riccardo

2009/10/19 Thiago Macieira <thiago at kde.org>

> Em Segunda-feira 19 Outubro 2009, às 11:03:30, você escreveu:
> > Hi,
> >
> > i have two QGraphicsItem with setZValue(32)
> > Those items are represented as rectangle on the screen
> >
> > both items have childs (smallest rectangle) with setZValue(40)
> >
> > The problem is this:
> >
> > If i drag a child of the first item on the second one it is drawed under
> >  the item while i espect it to be over the item due to the bigger Z
> >  value....
> >
> > Whi this appens?
>
> The Z-order applies to siblings only. So if you have two items that are
> children of the same parent with different z-order, the one with highest z-
> order will be drawn on top of the other.
>
> However, that's not what you have. You have two items that are siblings
> with
> the same z-order (32). And each of those has a child item, whose z-order
> doesn't matter.
>
> Since the two siblings have the same z-order, they and their children are
> drawn according to pointer address (I think). That's why the grandchild
> item
> is drawn under the child, even though the z-order is greater.
>
> --
> Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
>  Senior Product Manager - Nokia, Qt Development Frameworks
>      PGP/GPG: 0x6EF45358; fingerprint:
>      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
>
> Qt Developer Days 2009 | Registration Now Open!
> Munich, Germany: Oct 12 - 14     San Francisco, California: Nov 2 - 4
>      http://qt.nokia.com/qtdevdays2009
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091019/c1a9aae2/attachment.html 


More information about the Qt-interest-old mailing list