I have a QTreeWidget inside a QVBoxLayout that I would like to have sized so that all of the columns are visible (e.g. no horizontal scroll bar needed). How do I do this? I tried using

myTreeWidget->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysO ff)

or

myTreeWidget->setSizePolicy(QSizePolicy::Minimum,QSizePolicy::P referred)

or

vLayout->setSizeConstraint(QLayout::SetMinimumSize);

but these didn't help. I'm not sure if the QTreeWidget is providing poor sizeHints() or if the layout is just ignoring them (I'll check into that).