Columns auto-resize to size of QTableView

This code equally stretches each column so that they fit the table’s width.

table->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);

Docs:

Leave a Comment