Please nominate your Qt Champions for 2021!

How to resize QTableWidget width to fit the total column size?

  • Hi,

    I am trying to get the layout of my app setup and so I added 2 QTableWidgets side by size but as you can see, there is a gap here in each QTableView after the last column. Is there a way to resize the widget to full encapculate the columns without this empty space?

    I tried this but it didn't change anything:


    Thanks in advance.

  • Ok this worked:

    self.setSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Expanding)

Log in to reply