Hi Tapioca
My application also works with a large DB and I did not even consider using QSqlTableModel. I inherit my models directly from QAbstractItemModel. The application allows opening multiple instances of various view types over the same instance of a model. And, at the same time, I use different types of models to represent the same data stored in the database. The models are optimized for performance and are specific to the tasks of my application.
The models are connected and notify each other on data modifications. For example, when a user modifies data through a view, setData() is called on the target model. At this point the model notifies related models on what is about to happen and delegates the work to the database. When response arrives from the database, the model notifies its related models about the result of the operation and updates its internal data structures. The attached views pick up the changes. The notified models also update their internal data structures and their views also pick up the changes.
This is a simplified description of what is really happening. But I cannot imagine doing things differently when an application has to deal with millions of database records and at the same time being fast and responsive.
Just my 2 cents.




Reply With Quote
Bookmarks