Hi,
I have a model that I derived from a QAbstractTableModel. It provides access to a datasource.
When I modify a "row" equivalent of the datasource, I only know the index of that "row" until *after* the modification is done. It would be almost as expensive as the actual modification to find out the index of the "row" that is to be modified (and currently the datasource doesnt support that). the problem is of course that I need the row index for the beginInsertRows function.
I tried it, and it seems to work just fine to first modify the datasource and then call beginInsertRow + endInsertRow. The alternative is to do beginResetModel/endResetModel.
Do I have to expect any negative side effects? Would you recommend to just reset the model?
The same problem exists with beginRemoveRows.
Bookmarks