[Qt-interest] QGraphicsItem and setZValue..how it works?
Thiago Macieira
thiago at kde.org
Mon Oct 19 11:19:12 CEST 2009
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091019/011353bf/attachment.bin
More information about the Qt-interest-old
mailing list