Freezing columns in QTableView

In myModel table, I have two columns. This model is connected to TableView. How can I customize them so that these two columns fill the View table so that there is no free space?
EDIT:
enter image description here

+7
source share
1 answer

Try the following:

tableView->horizontalHeader()->setStretchLastSection(true); tableView->resizeColumnsToContents(); // not necessarily but can make look better 
+9
source

All Articles