Hi all,
I’m working in QTreeView data representation and I would like to show a TreeModel (inherited from QStandardItemModel) that only show the nodes but not the leafs of them. An example could be:
ROOT
NODE 1
LEAF
NODE 1.1
NODE 2
NODE 2.1
NODE 2.2
LEAF
And represented with the custom TreeModel like:
ROOT
NODE 1
NODE 1.1
NODE 2
NODE 2.1
NODE 2.2
I have tried overloading rowCount() of the model, overloading the return of the childCount() or rowCount() of each item but I have not accomplished what I want. I know how many childs are leafs so I can return the total value decreasing the total of leafs.
One problem is that in the TreeModel::data() I need some way to show the following node in case that the current index is a leaf (due to the childCount() reports only the total of nodes with child).
↧