Hi,


I have a model whose backingstore can change or outright die without me knowing what exactly changed, just that something changed. So I need to reset the entire model. I figured the method reset() is the perfect match here:

https://doc.qt.io/qt-5/qabstractitem...ete.html#reset

But it's obsolete, and Qt doc suggest I replace it with a beginResetModel() + endResetModel().


Problem is obviously that I dont know when my model is about to be reset, so I cant call beginResetModel before.



What's the protocol here? Should I just ignore the fact that the data is already reset and do

Qt Code:
  1. beginResetModel()
  2. endResetModel()
To copy to clipboard, switch view to plain text mode 

Documentation explicitly says:

You must call this function before resetting any internal data structures in your model or proxy model.

or should I just emit a lone "endResetModel()" call? That feels wrong.