I know that I am mistaken in this line:
self.model.beginRemoveRows(index.parent(),index.row(),self.model.rowCount(index))
Yes you are right. Let's see what you go through:
index.parent() - the parent of index
index.row() - the row number of index, the row you want deleted
self.model.rowCount(index) - the number of total children had by index
Now take a look at the image in the beginRemoveRows documentation :
Having said that, you want to remove from index.row()to a string equal to the number of children by index. Your incorrect matches with your parent and child indexes.
What did you really want:
beginRemoveRows(index.parent(), index.row(), index.row())
index.row(), .
, : beginRemoveRows() . , . endRemoveRows(), , , .
++ beginRemoveRows(), , .
, , - (.. QSortFilterProxyModel), , . QSortFilterProxy .