How to get position of Object in Model when using TreeListModel

When using a ColumnView and TreeListModel wrapped by a SingleSelection, you can get the position of the selected TreeListRow and the row itself using (abbreviated)

single_selection_model.selection();
sel_pos = selection.nth(0);
row = trm.row(sel_pos);

But if this a row at depth zero, Can you get the position of the row item in the original (unexpanded) model?

Basically if I select the 3rd parent where each has 6 children and I select the 2nd parent, the sel_pos above will be 7. How do I work out it is the second parent, without walking the whole model counting children of expanded rows?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.