0

I generate a QTableWidget in PyQT (Python). This is the result:enter image description here

as you can see the cells don't fill horizontally the table and a lot of space remains empty. I would like to make the cells stretch to a size that fills the table. How can this be done?

Gianf DS
  • 51
  • 1
  • 8
  • `table.horizontalHeader().setSectionResizeMode(QHeaderView.Stretch)`. – musicamante Jun 01 '22 at 17:12
  • Thanks, I had some problems because in PyQt6 the stretch mode is under QtWidgets.QHeaderView.ResizeMode.Stretch – Gianf DS Jun 01 '22 at 23:13
  • Sorry, my bad, I didn't pay attention to the tag. All Qt enums use the full flag name under PyQt6, as they are not direct members of the class anymore. I know, that's a bit annoying (and excessively verbose, IMHO, since Qt names are already *very* long). Remember that every time you see a flag/enum that doesn't use the full syntax (because it was used in – musicamante Jun 01 '22 at 23:25

0 Answers0