Automatic sizing of QTableWidget's cells
I try to create the QTableWidget with the number of columns and rows specified at the moment of creation and then populate its cells with widgets using setCellWidget().
It works except for one moment: the widget is resized to fit the cell. I tried setting the widget's minimal size, but it resulted in a really bad outcome: the cell size remained the same, and widgets started overlapping, creating a total mess in the table.
Is there a way to make Qt set the height of rows and width of columns so that the biggest widget fits well?
Re: Automatic sizing of QTableWidget's cells
You can try checking the sizeHint of all the cells, and with this set the minimum size of both the columns and rows
Re: Automatic sizing of QTableWidget's cells
I found the solution: the QTableView has resize{Rows,Columns}ToContents() functions.
I should read mans more attentively:o .