0

I have a question abour QtDesigner.

I have created a QTableView and filled it with 3 columns. The probleme is that I dont find the option to strech them :

QTableView with non streched columns I saw that I can stretch the last one but that all.

Any Idea on how can I make that ?

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
Pixi
  • 33
  • 1
  • 7
  • Not sure if this is possible from within Qt Designer, but you can do this programmatically via `QTableView.horizontalHeader().setSectionResizeMode(i, QHeaderView.Stretch)`. – Heike Oct 02 '19 at 11:34

1 Answers1

0

Thanks to @Heike for the answer :

for i in range(self.tableWidget.columnCount()):
    self.tableWidget.horizontalHeader().setSectionResizeMode(i, QtWidgets.QHeaderView.Stretch)
eyllanesc
  • 235,170
  • 19
  • 170
  • 241
Pixi
  • 33
  • 1
  • 7