Hi Jason

To my understanding the reason for not having contentHeight (and childrenRect.height too BTW) is that by the moment of view creation there is no content yet. And if you have very large model some of its elements may never be instantiated. ListView creates elements on demand and after it's been created itself.

So if you want to size the view according to its content, you are to do some math regarding the element height and expected number of elements. This way for example: http://pastebin.com/Eh6gm8qZ

BR,
Artem.

On Aug 24, 2011, at 7:18 AM, Jason H wrote:

I am trying to use a ListView, but I cannot figure out how to do what I want.

My problems are such:
I want to anchor the list to the bottom left of the parent (easy)
However, I am not sure how big to make the ListView height and width.
If I guess wrong, the list view allows me to scroll (good)
But I'd like to have the items sink tothe bottom.

In the old days, I'd have used a spacer to push them down, but the ListView seems to always want to float items to the top. I don't see a setting on how to do this. If I could know the contentHeight, I'd set the height to that. But when I set

height:view.contentHeight

I get an error "can't find view" even though it is an attached property in the docs.

Help?

_______________________________________________
Qt-qml mailing list
[email protected]
http://lists.qt.nokia.com/mailman/listinfo/qt-qml

_______________________________________________
Qt-qml mailing list
[email protected]
http://lists.qt.nokia.com/mailman/listinfo/qt-qml

Reply via email to