Reputation: 495
I need to set the width of a column in my QTreeWidget to a fixed size. setColumnWidth() appears to have no effect, and the code given here results in the compiler error " 'headerView': is not a member of 'QTreeWidget' ".
I am using Qt 4.7.4.
Upvotes: 3
Views: 4934
Reputation: 4335
QHeaderView::resizeSection() may work for you. Try doing the following code:
treeWidget->header()->resizeSection(index, width);
Upvotes: 2