如何在QTreeView中跳过单元格?

时间:2015-07-16 04:31:14

标签: c++ qt4 qtreeview qsortfilterproxymodel

条件:C ++ / Qt 4.8.6。我有一个QTreeView对象,它与自定义树模型链接。树的叶子看起来像这一行:

[module] [operation1] [operation2] [operation3] [operation4]

因此,“module”在0列中,后跟“operation”单元格。每个操作都在一个单独的列中。我有一个复选框“隐藏已完成的操作”。如何在QTreeView中隐藏/跳过已完成的操作?每个操作都有相应的布尔属性finished。此属性可以随时设置为true。我想“挤”一排。我知道Qt中的代理模型,但我无法弄清楚如何应对我的情况(虽然我已经google了很多)。我应该使用其他活动操作列表(使用共享指针)吗? 这是一个例子:

过滤前:

[根]

- [组别1]

---- [module1] [finished operation1] [operation2] [operation3]

---- [module2] [operation1] [operation2] [finished operation3] [operation4]

过滤后:

[根]

- [组别1]

---- [module1] [operation2] [operation3]

---- [module2] [operation1] [operation2] [operation4]

0 个答案:

没有答案
相关问题