[Qt-qml] Adjusting Flickable contentHeight to variable children ListViews

jens.bache-wiig at nokia.com jens.bache-wiig at nokia.com
Tue Oct 11 11:05:47 CEST 2011


Unless you put those ListViews in a Column (or anchor them) and explicitly set their height (bind each view's height to its own contentHeight), the childrenRect will not make sense. They are all stacked on top of each other right now. Also, I suspect you should set the interactive flag to false on the ListViews so they don't interfere with top-level Flickable. For the fixed height views, you could alternatively have used repeaters instead of ListViews.

Regards,

Jens


On Oct 11, 2011, at 10:22 AM, ext Matti Mäki wrote:

> Hi,
> 
> Flickable {
> 
>     contentHeight: //..?
> 
>     ListView {
>         visible: // always
>         contentHeight: // fixed
>     }
>     ListView {
>         visible: // always
>         contentHeight: // fixed
>     }
>     ListView {
>         visible: // sometimes
>         contentHeight: // variable
>     }
> }
> 
> How should I define the Flickable contentHeight so it will adjust 
> correctly to the changing children? Binding to childrenRect.height does 
> not seem to do the job. The two upper ListView's are always visible and 
> have fixed heights but the third is shown only when user expands it, and 
> it might have any number of elements from 1 to 20 or something.
> 
> /matti
> _______________________________________________
> Qt-qml mailing list
> Qt-qml at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-qml



More information about the Qt-qml mailing list