我们在 .NET 中有 ListView.Groups。 Qt 中是否有等效项(不使用 Windows API)?
我在 Qt 的文档中找不到任何表明对此支持的内容。
Windows Vista/7 中的示例:http://i50.tinypic.com/zumgyg.jpg
提前致谢!
最佳答案
看起来用Qt model-view 很容易做到这一点控制。
起初有点令人困惑,但基本上所有列表、树控件和网格都以相同的方式处理 - 这让您可以非常轻松地对它们进行有趣的组合。
编辑:Casey在已删除的答案中发布了有用的评论。 这是文本和链接:
creating your tree model is pretty straight forward. To create that "grouped" effect where the parent nodes look different then their children, I would suggest creating an ItemDelegate then setting it on your view using setItemDelegate1. In the Delegate's paint function you can detect whether the index is a header or now, and draw something appropriately. When you get there if you need help, start another question and I can post an example.
http://doc.trolltech.com/4.6/qabstractitemview.html#setItemDelegate
关于windows - 使用 Qt 的 ListView 组?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3195246/