1.1函数函数:setSectionResizeMode(),表示均匀拉直表头。示例用法如下:
tableView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
1.2函数setStretchLastSection()表示将最后一列填充满表格。用法示例如下:
tableView->horizontalHeader()->setStretchLastSection(true)
参考内容:
https://blog.youkuaiyun.com/y396397735/article/details/78494916