PDA

View Full Version : Is setting setColumnWidth of QTableWidget not possible in Qt Designer?



sodlqnf123
9th July 2018, 11:19
12896

I can not find both setColumnWidth and resizeColumnsToContents in Qt desginer. (Though I prefer former to latter)
I can do it manually, but then I have to add additional code and I think it is not desirable.

d_stranz
9th July 2018, 19:19
I have to add additional code and I think it is not desirable.

Well, sometimes you just have to bite the bullet and actually write a few lines of code instead of just dragging and dropping icons. You -can- use Qt Designer to set the minimum and default section sizes for the horizontal header.

In any case, how could Designer know how to apply a call to resizeColumnsToContents when all it has is an empty table? It isn't until run time that you put things in the table cells.

sodlqnf123
10th July 2018, 16:51
Then how about just applying different width to each column header? Is it impossible too in Qt designer? Those options shown in above picture change whole headers.