Actually, the problem is somewhere else. Forget what I said before.
The docs say:
You were clearing the data and also reset the model before recreating the back store. This happens in function TableModel: populate.Resets the model to its original state in any attached views. When a model is reset it means that any previous data reported from the model is now invalid and has to be queried for again.
When a model radically changes its data it can sometimes be easier to just call this function rather than emit dataChanged() to inform other components when the underlying data source, or its structure, has changed.
The error was that when you called reset on the model, it tried to reinitialize with new data ( header views, etc ). But there was no new data, because it was created after you reset the model.
The solution is to call reset just after setModelData(), in populate.
This way the model will have an update source available.
Regards
Bookmarks