繁体   English   中英

在QTableView中拟合列

[英]Fitting columns in QTableView

在我的TableModel中,我有两列。 此模型连接到TableView。 我如何设置它们以便这两列填充tableView所以没有可用空间?
编辑:
在此输入图像描述

尝试这个:

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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