As @UmNyobe said, this is not possible with the designer, but you can use this trick to visually set the width according to what you want.
Add this code to the dialog's destructor, and it will print the column width for each column, as well as the width of the tree widget and the dialog itself.
SettingsDialog::~SettingsDialog() { QHeaderView *header = ui.treeWidget->header(); for (int ii = 0; ii < header->count(); ++ii) { qDebug() << "column" << ii << ":" << header->sectionSize(ii); } qDebug() << "tree widget width: " << ui.treeWidget->width() << ", dialog width:" << width(); }
So, you can run your program, adjust the width of the columns as you want, and when you close the dialog, you will see what widths you need:
column 0: 110
column 1: 110
column 2: 110
column 3: 110
tree widget width: 440, dialog width: 543
This is not much, but better than trying to guess what widths look good without visual feedback.
source share