View Full Version : QTreeWidget, proper resizing of columns

6th November 2007, 00:47
I have a QTreeWidget with 3 columns and i want it to behave like this:
2nd and 3rd columns should be Mininum-size, i.e. the column should be wide enough to show the biggest item completely, but no wider.
The 1st column should be "Minimun-Expanding", i.e. just like the Widget-behaviour.
The QTreeWidget should never show vertical scrollbars and hide no textparts of any item in any column.

I already tried this back in Qt3-times and never could make it work right....

Thanks for help!!

6th November 2007, 01:29
Set the resize mode of sections 1 and 2 to ResizeToContents and resize mode of section 0 to Stretch. Also remember to call setStretchLastSection(false).

6th November 2007, 02:06
Awesome, it just works the way I want it to!

Thanks a lot!