PDA

View Full Version : QML scrollable row element



KeineAhnung
25th April 2015, 07:49
Hi,

again I am completely stuck here. I would like to create column with two rows. The first row I kind of a title row and shall stay at the top. The second "row" contains a ListView with logs. I would like to have this ListView scrollable but I am just not getting it right.
This is my structure:


SilicaFlickable {
Column {
Row { // Title }
Flickable {
width: page.width
height: column.height - titleRow.height
flickableDirection: Flickable.VerticalFlick

VerticalScrollDecorator {}
clip: true

ListView {}
}
}
}


The ListView is scrolling now but as soon as I leave it it scrolles back to it initial state. How can I prevent that or how can I do this better?

Thanks

wysota
25th April 2015, 09:05
What is the purpose of a Flickable element you declare in line #4?

A column with two rows where one is a title row and the other is a list view looks more or less like this:

Column {
anchors.fill: parent // or whetever
Item { id: title /* ... */ }
ListView { id: view }
}

KeineAhnung
25th April 2015, 10:12
Hi,

the Flickable is the container I wanted to be scrollable. But I does not behave as I hope. I will try your structure.

Thanks

wysota
25th April 2015, 15:25
What is there to scroll?

KeineAhnung
25th April 2015, 15:34
The ListView contains several lines.

I finally fixed by attaching the ListView to the bottom of the column and assigning a specific hight. Then the SilicaListView will automatically scroll when the list is too long.

wysota
25th April 2015, 15:51
The ListView contains several lines.
ListView is already scrollable.