Deriving "leftover" space value
-
Hi all -
Consider this code snippet:
ColumnLayout { id: newZone // other stuff ListView { id: viewArea Layout.preferredHeight: // what do I put here? Layout.preferredWidth: newZone.width clip: true model: 100 delegate: Text { text: model.index; font.pixelSize: 10 } } }
Is there a way to automatically derive the available space for my ListView's height, or do I need to do the arithmetic of:
leftover = newZone.height - otherStuff.height
Thanks...
-
@JoeCFD I don't want to set the ListView height to its content height; that causes the problem I'm trying to solve. I want to set the ListView height to whatever is available.
Layout.fillHeight: true
uses all the remaining height. -
Hi all -
Consider this code snippet:
ColumnLayout { id: newZone // other stuff ListView { id: viewArea Layout.preferredHeight: // what do I put here? Layout.preferredWidth: newZone.width clip: true model: 100 delegate: Text { text: model.index; font.pixelSize: 10 } } }
Is there a way to automatically derive the available space for my ListView's height, or do I need to do the arithmetic of:
leftover = newZone.height - otherStuff.height
Thanks...
-
@mzimmers is Layout.preferredHeight equal to 100 * 10(text numbers * font size)?
But normally there is some space among the rows of ListView.
It may not be a good idea to do
delegate: Text { }
I use
delegate: Rectangle { } -
@JoeCFD I don't want to set the ListView height to its content height; that causes the problem I'm trying to solve. I want to set the ListView height to whatever is available.
Layout.fillHeight: true
uses all the remaining height. -
M mzimmers has marked this topic as solved on
-
@GrecKo I knew that. Seriously, I did.
My app was misbehaving due to some conflicting settings, but once I emptied the trash, it worked just as you said.
Thanks...
@mzimmers said in Deriving "leftover" space value:
but once I emptied the trash
https://www.youtube.com/watch?v=Wf7seK3n9rE sorry, not sorry