PDA

View Full Version : Automatically adjust width of columns in QTableWidget



Morea
18th September 2007, 22:57
I have one of those, with 4 columns . 2 checkboxes in the left most ones, and then the next columns will be filled with strings. Isthere a way to get Qt to automatically resize columnwidths and set suitable widths of the columns? The checkbox columns could be narrow, the other ones, well, wider.

Or how do you set these widths?

Edit:
Sorry, just found this!
resizeColumnsToContents()

works fine!

wysota
19th September 2007, 10:32
It's always best to solve your problems yourself ;)