Qt 6.11 is out! See what's new in the release
blog
How to set the width of one column in treeview to be fixed and the other colume to be auto fit while window resized?
General and Desktop
2
Posts
2
Posters
11.6k
Views
1
Watching
-
One problem in coding with treeview:
@public class ReportGrid extends QTreeWidget {
public ReportGrid (QWidget parent) {
super(parent);
this.setRootIsDecorated(false);
this.setAlternatingRowColors(true);
ArrayList<String> labels = new ArrayList<String>();
labels.add("Description");
labels.add("Requird");
this.setHeaderLabels(labels);
header().setResizeMode(QHeaderView.ResizeMode.Interactive);
//this.setModel(model);
this.setColumnWidth(0, 200);
this.setColumnWidth(1, 20);
}
}@
I want set the "Description" column 200px min width and "Required" column to be 20px width fixed(it contains an icon).
But while window resizing the column “Requird” expands.
Thanks.