如何在 GtkTreeView 中显示 GtkTreeStore 的平面表示?
我有一个 TreeStore,其中包含通过 GtkTreeView
/GtkTreeModel
设置查看和操作的对象。
我还有一个 TreeView,显示 TreeStore 的 TreeModelSort,我用它对名称和日期等列进行排序。
问题是,排序机制仅对根节点进行排序,即使底层子节点的日期晚于/早于根节点的日期。
因此,问题是是否有任何方法可以将对象显示为列表(而不是树),但保留对其他 TreeView 中路径的引用?
I have a TreeStore with objects that I view and manipulate through a GtkTreeView
/GtkTreeModel
setup.
I also have a TreeView showing a TreeModelSort of the TreeStore, which I use for sorting on columns like name and date.
The problem is, that the sort mechanism only sorts the root nodes, even if a underlying child node has e.g. a date that is later/sooner than the roo tnodes' dates.
So, the question is if there is any way to show the objects as a List
, not a tree, but keeping the references to the paths in the other TreeView?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议使用 TreeModelFilter 过滤掉所有子行(即深度 > 1)。您可以过滤排序的模型,并仅显示根节点。
I would suggest a TreeModelFilter that filters out any rows that are child rows (ie, depth > 1). You can filter your sorted model, and display just the root nodes.