7

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

user336635
  • 2,081
  • 6
  • 24
  • 30

1 Answers1

9

Try this:

tableView->horizontalHeader()->setStretchLastSection(true);
tableView->resizeColumnsToContents(); // not necessarily but can make look better
Andrey Atapin
  • 7,745
  • 3
  • 28
  • 34