On 05/10/2010, at 5:33 AM, ext Adriano Rezende wrote:
> I noticed that when a Row's child item is destroyed, the Row does not
> reconfigure its geometry sometimes.
> 
> Follows a code to reproduce this behavior:
> 
> ======================================================
> import Qt 4.7
> 
> Item {
>    width: 600
>    height: 300
> 
>    MouseArea {
>        anchors.fill: parent
>        onClicked: itemComponent.createObject(row);
>    }
> 
>    Row {
>        id: row
>        spacing: 2
>    }
> 
>    Component {
>        id: itemComponent
> 
>        Rectangle {
>            id: item
>            width: 80
>            height: 80
>            color: "red"
> 
>            MouseArea {
>                anchors.fill: parent
>                onClicked: {
>                    // item.visible = false; // XXX: workaround to relayout
>                    item.destroy();
>                }
>            }
>        }
>    }
> }
> =====================================================
> 
> Looking at the Positioner's code
> (QDeclarativeBasePositioner::itemChange() method), it seems that it
> fails to cast to QDeclarativeItem in this case.
> 
> Someone knows if this is a bug?

I wasn't able to reproduce this on my machine, but from the description it 
sounds like it is only failing intermittently for you? In any case, Row should 
always relayout when a child is destroyed (though note that the QML destroy() 
calls deleteLater() than than deleting immediately); if it doesn't then yes it 
is a bug. 

Regards,
Michael
_______________________________________________
Qt-qml mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-qml

Reply via email to