简体   繁体   中英

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:
在此输入图像描述

Try this:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM