[Qt-qml] Reordering children

Gregory Schlomoff gregory.schlomoff at gmail.com
Sun Sep 12 04:58:44 CEST 2010


It depends of what you mean by order.

Usually, the order of the children just determine their stacking position
(ie: the second child will stack over the first, the third will be over the
second, etc...). In this case, you can change the stacking order with the z
property.

In your case, the order of the Rectangles determine how the Column will
position them, so what you really have  is a position problem, not an order
problem. And if I recall correctly, the doc for Column states that you can't
dynamically change the position of the items managed by the column.

So what would probably work in your case would be to anchor the rectangles
to each other, and to dynamically change the anchors.

Cheers,

greg

On Sun, Sep 12, 2010 at 9:02 AM, Alex
<alexlordax+qt at gmail.com<alexlordax%2Bqt at gmail.com>
> wrote:

> Hi all,
>
> Is there a way to dynamically change the child order of a particular
> Item?  For example, suppose I have two Rectangles in a Column, and I
> sometimes need to reverse their order.
>
> Cheers,
> Alex
> _______________________________________________
> Qt-qml mailing list
> Qt-qml at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-qml
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-qml/attachments/20100912/e61f790c/attachment.html 


More information about the Qt-qml mailing list