Answers for "pyqt5 change table widget column width"

0

pyqt5 change table widget column width

header = self.table.horizontalHeader()       
header.setSectionResizeMode(0, QtWidgets.QHeaderView.Stretch)
header.setSectionResizeMode(1, QtWidgets.QHeaderView.ResizeToContents)
header.setSectionResizeMode(2, QtWidgets.QHeaderView.ResizeToContents)
#the first column will stretch to fill the window and the others will resize 
#to the contents. If you want them to be equally sized change all resize modes
#to QtWidgets.QHeaderView.Stretch
Posted by: Guest on March-14-2021

Code answers related to "pyqt5 change table widget column width"

Python Answers by Framework

Browse Popular Code Answers by Language