PDA

View Full Version : QTableView/QTableWidget - how to resize widget to size of table?



will49
28th May 2009, 22:38
Is there an easy way to resize a QTableView/QTableWidget so that it is the size of the table exactly?

I'm filling the table with data, then calling reizeColumnsToContents() so the columns are the right width for the containing data, but now I want to change the size of the whole table widget so it is the right size. i.e. doesn't have any blank space on the right of the table.

The only way I can see so far is to calculate the widths of each column and the header and resize that way.