How to get right row height in Qt for QTableView object?

DragonionS picture DragonionS · Sep 10, 2010 · Viewed 10.5k times · Source

From this screenshot you can see a lot of space inside the rows:

alt text

I've used these functions to get resizing:

resizeRowsToContents();
resizeColumnsToContents();

How can I get a better fit for cells/rows sizes?

Answer

Arnold Spence picture Arnold Spence · Sep 11, 2010

Try these:

verticalHeader()->setDefaultSectionSize(int size)
horizontalHeader()->setDefaultSectionSize(int size)