I have TableView
with 4 columns. When I enlarge width of main window, I needed enlarge first column width too.
Older way (non QML) was:
QTableView->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch );
Now I do something like example bellow, but this is not exactly perfect.
- When I resize some column, this construction stop working. All columns stay in actual state and stop resizing when main window change his size.
- When I add new columns in future (forgot rewrite this codeine) or add some columns dynamically, this stop working too.
QML file: :
TableView {
id: ccPanel
model: ccModel
TableViewColumn {
id: ccName
role: "name"
title: "Name"
width: ccPanel.width - ccSize.width - ccDate.width
}
TableViewColumn {
id: ccSize
role: "size"
title: "Size"
width: 60
}
TableViewColumn {
id: ccDate
role: "Date"
title: "Datum"
width: 85
}
}
Do you know how to help me?
resizable
asfalse
those error should be fixed. But I don't know if the user should be able to resize columns or not. – Tarod