@mcosta
@sahadum
Thank you for your responses! Both of these are great points. I have a similar implementation to Sahadum's suggestion in place regarding item roles, and Mcosta, that's the EXACT thing I was doing to determine if it's a child node.
The only problem is, when I query my selectionModel->selectedRows(), my rows still are out of order. When I run my foreach loop, this is what's given to me:
rows - 0, 0, 0, 1, 1, 1, 2, 3, 4, 5
deconstructed as below:
item3:child1.row() ==0,
item4:child1.row() == 0,
item1.row()==0,
item3:child2.row()==1
item4:child2.row()==1
item2.row()==1
This is the order that the rows are presented to me in the foreach loop. I tried ignoring child nodes, and then adding their data to my QStringList when I encounter a parent. This orders things properly, but what if I select ONLY a child line, for instance Item3:Child1 - this will be ignored and not be copyable. I must then copy the parent and get ALL the children.
I still need a means of walking through my selectionModel that will give me the rows in the order they appear in my Treeview.