找到原因了, 调用resizeColumnsToContents()解决了。这个地方QT的help文档做的不好。
From stackflow
--------
When you are loading the previous width of the hidden columns, the width that was saved was 0.
So, when resizing the column make sure that the width is greater than 0.
Do this and then the columns will show/hide as expected.
【 在 Upiter 的大作中提到: 】
: 我有一个view,首先给他设置了一个model,然后我调用setColumnHidden隐藏了几列
: 接着这个model改变了,我想再调用setColumnHidden把之前隐藏的几列显示出来,但是不成。
: 请问什么原因。
: ...................
--
FROM 83.233.107.*