Use rowHeightProvider for proper row sizing

TreeView (inherits TableView) defaults to fixed row heights. Setting
rowHeightProvider to return -1 tells it to use each delegate's
implicitHeight, enabling variable-height rows.
This commit is contained in:
Levi Neely 2026-10-01 09:29:35 +02:00
parent b0a4956d8f
commit 04425d9e9f
1 changed files with 3 additions and 0 deletions

View File

@ -10,6 +10,9 @@ TreeView {
id: tree
clip: true
// Force TreeView to calculate row heights per-row instead of using a fixed height
rowHeightProvider: function(row) { return -1 } // -1 means "use delegate's implicitHeight"
readonly property int rowPad: 6
readonly property int baseFontSize: theme.fontSize > 0 ? theme.fontSize : 12