PDA

View Full Version : QTreeWidget, proper resizing of columns



soul_rebel
5th November 2007, 23: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!!

wysota
6th November 2007, 00: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).

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

Thanks a lot!