QTreeView 切换选项卡位置

发布于 2024-10-16 18:13:44 字数 371 浏览 9 评论 0原文

我有一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

花开浅夏 2024-10-23 18:13:44

我自己发现的。它实际上很容易。

如果我们只是调用 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 with swapSections(1, 0) will swap the first and second column.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文