View Full Version : Resizing QTableWidget Columns

26th September 2008, 15:10
I have a QTableWidget with multiple columns. I'd like column one to stretch in response to a change in table size and also be resizeable interactivley. Is this possible? I've tried using QHeaderView::resizeMode and from the documentation it seems these behaviors are mutually exclusive.

29th September 2008, 09:30
What should happen if user had resized a section and then the header grows? Should the user-defined size remain or should it stretch?

29th September 2008, 21:44
I'd like the same behavior provided by QHeaderView::stretchLastSection but for the first section.

29th September 2008, 22:39
doesn't QHeaderView::setResizeMode ( int logicalIndex, ResizeMode mode )
work (with logicalIndex=0 and ResizeMode=QHeaderView::Stretch)?

29th September 2008, 23:26
According the documentation for QHeaderView::Stretch:

"QHeaderView will automatically resize the section to fill the available space. The size cannot be changed by the user or programmatically."

I've tried so many different things I can't say with certainty, but I seem to recall verifying the documentation is correct.