PDA

View Full Version : Fixed size and scrollable ListView



mushroom
12th October 2011, 23:01
Hi,

I have an application that shows a rectangle in the middle of the screen which contains 2 visual items: a ListView at the top, and a button column at the bottom and both items are anchored together to be above/below each other.
The problem I'm having is that if the list gets too big, the list items appear behind the buttons at the bottom, or just grow upwards when i scroll down if i remove the anchoring.

How do i make the list fixed in size inside the rectangle, and make it hide certain elements when it gets too big? So then i can scroll down and the hidden elements would appear and the list doesn't grow outside of the frame.
I could solve this by hiding each element when its Y value is more than the top of the rectangle or less than the bottom of it, but there's gotta be a better way to do it.

Thanks!

edit: the picture shows the list only, there's empty space around it.

tsp
13th October 2011, 08:21
Set the clip (http://doc.qt.nokia.com/latest/qml-item.html#clip-prop) property to true and see whether it makes any difference to results.

mushroom
13th October 2011, 12:19
Yes, that did the trick.
Thanks!