Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make QTableWidget's columns assume the maximum space?

The columns of my QTableWidget do not fill in the space of the table, so that an empty space is left on the right hand-side. How to make the columns of my QTableWidget assume the maximum space so as to fill in this space?

like image 925
neydroydrec Avatar asked Aug 07 '12 05:08

neydroydrec


1 Answers

The headers of the table have methods for controlling this:

header = table.horizontalHeader()
header.setStretchLastSection(True)

or:

header.setResizeMode(QHeaderView.Stretch)
like image 121
ekhumoro Avatar answered Sep 27 '22 20:09

ekhumoro