setSectionResizeMode(QHeaderView ::弹力);从视口伸出桌子

时间:2016-05-12 18:56:16

标签: qt

我尝试使用Qt的内置功能进行表格拉伸拟合(table->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);),但表格从视口伸出。

我记得在某个地方看到可能没有解决方案而且我必须做一些子类化,因为滚动区域的目的是首先允许这种超出范围,但无论如何:

我的目标是:

enter image description here

我得到了什么:

enter image description here

造成这种情况的原因以及解决方法是什么?

1 个答案:

答案 0 :(得分:0)

问题是QHeaderView::minimumSectionSize()。标题部分不能缩小到这个大小以下。