PDA

View Full Version : Resizing QTableWidget Columns



mbrusati
26th September 2008, 14: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.

jpn
29th September 2008, 08: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?

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

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

mbrusati
29th September 2008, 22: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.