1.自动适应列宽
#自动适应列宽
self.tableWidget.horizontalHeader().setSectionResizeMode(QHeaderView.Stretch)
2.手动适应列宽
#自动调节列宽
self.tableWidget.horizontalHeader().setSectionResizeMode(0,QHeaderView.Interactive)
1.自动适应列宽
#自动适应列宽
self.tableWidget.horizontalHeader().setSectionResizeMode(QHeaderView.Stretch)
2.手动适应列宽
#自动调节列宽
self.tableWidget.horizontalHeader().setSectionResizeMode(0,QHeaderView.Interactive)