PDA

View Full Version : Creating H-scroll free sized QTreeWidget/QTreeView inside a layout



cboles
17th March 2006, 22:05
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::ScrollBarAlwaysOf f)

or

myTreeWidget->setSizePolicy(QSizePolicy::Minimum,QSizePolicy::Pr eferred)

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).

fullmetalcoder
18th March 2006, 10:18
Amazing! I myself use QTreeWidget and I can't get any scrollbar even when it's needed...