I am having troubles setting column widths with a QTreeWidget. The code snippet is as follows:
categories = QTreeWidget(my_widget)
categories.setColumnCount(2)
categories.setHeaderLabels(['Objects', 'Count'])
categories.currentItemChanged.connect(categoriesChanged)
vbox.addWidget(categories)
categories.setColumnWidth(1,66)
It seems like the final line isn't doing as I expected. Whst i would like is for the rightmost column to be much narrower than the left column.
By dragging the seperator in the header, I can successfully drag the columns to give the desired relative widths, and then by inspecting the categories.columnWidth property, I can see that the widths have changed, but I cannot seem to explicitly set the column width programmatically.
Thankyou,
Stuart