These two statements seem inconsistent to me:
The model models a global datastore in my program, but this store is internally threadsafe, and it's assumed that multiple threads will modify the data in itIf your global store has only one client (second statement), why do you say multiple threads will modify it (first statement)? Do you mean to say that in your program, your model is the only accessor of the data store, but there could be other programs that are also accessing and possibly modifying it?the model abstracts my global store, and no other place accesses my global store.
You might have to implement more than just the beginResetModel / endResetModel methods - like those for row insertion and removal - unless you want to completely reload the table view every time the database changes.
Presumably the QSqlTableModel and QSqlTableView classes have been implemented to handle the scenario you are describing. It might be worthwhile to study that source code for ideas. If your data store is based on an SQL DB, then you might be able to use those classes instead of rolling your own.
Bookmarks