I thought it was QTableWidget..

Qt Code:
  1. #include <QHeaderView>
  2. QTreeWidget* treeWidget = ...;
  3. treeWidget->header()->resizeSection(0, 20); // column 0, width 20
  4.  
  5. QTableWidget* tableWidget = ...;
  6. tableWidget->horizontalHeader()->resizeSection(1, 50); // column 1, width 50
  7. tableWidget->verticalHeader()->resizeSection(2, 15); // row 2, height 15
To copy to clipboard, switch view to plain text mode