[Qt-qml] Flickable with dynamically growing children

Bo Elmgreen bo.elmgreen at gmail.com
Fri Mar 18 11:28:56 CET 2011


Hi all,

I have been playing around with the following example:
http://wiki.forum.nokia.com/index.php/How_to_create_a_Collapsible_Panel_with_QML

I would like to have a list with two collapsible groups, but instead of each
group being flickable, as in the example, I would like the combined list to
be flickable.
So, I have embedded my two collapsible panels in a Flickable item and set
their interactive properties to false. This works ok as long as I have a
static elements in the two lists or if they are loaded from a file. But now
I receive the elements over a network connection one by one, and then I have
problems with setting the height - both of the two lists and of the content
of the surrounding flickable :-/ Now I give the Flickable's contentHeight a
default value as well as the two collapsible panels, and then I try to
update their height dynamically by reacting on ListView.onAdd in their
ListViews:

ListView{

        id: listView

        width: parent.width

        height: parent.height-titleRect.height

        anchors.top: titleRect.bottom

        interactive: false

        model: customModel

        delegate: customDelegate

        ListView.onAdd: { myRect.setHeight(60); console.log("listview on add") }

    }


- but it doesn't seem to be called... so their heights remain fixed.

So, I was wondering if there was a "standard way" of handling this?

Thanks,
Bo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-qml/attachments/20110318/29db0df7/attachment.html 


More information about the Qt-qml mailing list