Get all children QTreeview / QStandardItemModel
I have tree like this -
+Parent1 + Child10 - Child11 - GrandChild110 - GrandChild111 - GrandChild112 +Parent2 + Child20 - Child21 - GrandChild210 - GrandChild211 - GrandChild212
I would like to write function something like, based on parent, I want to get first level of children.
Example, In the above example, children of Parent1 is
+Parent1 + Child10 + Child11
I want to get them alone.
Children of Child21 are
- Child21 - GrandChild210 - GrandChild211 - GrandChild212
How do I achieve this in a neat straight forward way?
Do you mean filter out children lower than one level under Parent ?
@SGaist Yes, correct Sam. Should I need to use proxy filters?
That's a good start for filtering yes. The QSortFilterProxyModel might be a good starting point.