Reseting the model informs each attached view that all the data has become invalid and has to be fetched again. Which kind of model are you using? Avoid reseting the model, it causes all the selections and expand/collapse states to disappear. It should be enough to call QAbstractItemModel::beginInsertRows() and QAbstractItemModel::endInsertRows() to inform the views about the inserted items. Take a look at this explanation.
You should never store QModelIndexes for later usage. They are temporary objects locating some data in the model in the current situation. They become invalid as soon as the model changes. There is a class called QPersistentModelIndex for keeping persistent references to the model. Just be aware that maintaining them is expensive, and you don't need them for behavior you want.
Bookmarks