Hi,

I have a QTreeView with Custom Read-only Model derived from QAbstractItemModel. (Followed Qt example:SimpleTreeModel).
During refresh call, I want to clear/delete all the child nodes under the selected parent node index. What should be the best way to achieve this ?

1. Do i need to call removeRows() on the selected index ? I don't think this will help as the items to be deleted are not coming from the view.

2. Do i need to loop through the childCount() and delete each ?

Or any other way to do this ?