QTreeView 切换选项卡位置
我有一个 qt 对象 QTreeView 我想切换选项卡位置。 基本上我有一个填充的 TreeView。该函数
columnViewportPosition ( int column )
对于第一列返回 0
,对于第二列则返回 50
。我想切换它们,以便以不同的顺序显示,以便 columnViewportPosition
将为第一列返回 50
,为第二列返回 0
第二。我该怎么做?
I have a qt object QTreeView and I want to switch tab positions.
Basicly i have a filled TreeView. And the function
columnViewportPosition ( int column )
returns 0
for the first column and let's say 50
for the second. I want to switch them so that the are displayed in a different order, so that columnViewportPosition
would return 50
for the first column and 0
for the second. How do i do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我自己发现的。它实际上很容易。
如果我们只是调用
header()
函数来获取 QHeaderView< /a>,它具有所有必要的功能。例如,使用
swapSections(1, 0)
调用的函数swapSections
将交换第一列和第二列。Found it out by myself. Its actually really easy.
If we just call the
header()
function to get the QHeaderView, it has all the necessary functions.For example the function
swapSections
called withswapSections(1, 0)
will swap the first and second column.