def resizeEvent(self, event): QTableWidget.resizeEvent(self, event) header = self.horizontalHeader() # resizes the column headers to fit the contents, # currently this overwrites any manual changes to the widths of the columns header.resizeSections(QHeaderView.ResizeToContents) # then allows the users to resize the headers manually header.setSectionResizeMode(QHeaderView.Interactive)
def resizeEvent(self, event): QTableWidget.resizeEvent(self, event) header = self.horizontalHeader() header.setSectionResizeMode(QHeaderView.Interactive)