After filling a QTableWidget table I call:
table->resizeRowsToContents();
This makes the rows narrower but there is still a lot of padding between each row, as you can see here:
Looking at the documentation I found I could set the hight of each row with:
table->verticalHeader()->setDefaultSectionSize(16);
This removes the padding and gives me the tight spacing I want:
However, I'm concerned about using an absolute size in pixels. If the the system font is set to something large the text might not fit in the row.
Is there a way to remove the padding between rows while ensuring the text will always fit?