Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fitting columns in QTableView

In my TableModel I've two columns. This model is connected to the TableView. How can I set them up so those two columns fill the tableView so there is no free space?
EDIT:
enter image description here

like image 659
user336635 Avatar asked Dec 13 '11 10:12

user336635


1 Answers

Try this:

tableView->horizontalHeader()->setStretchLastSection(true);
tableView->resizeColumnsToContents(); // not necessarily but can make look better
like image 183
Andrey Atapin Avatar answered Oct 06 '22 15:10

Andrey Atapin