Dear all,

I am using QT4.4 to view and update a SQLite table storing few millions of records

I created a QSqlTableModel from this table. This model is displayed in a QTableView. Fine but I need several different editable views of the table simultaneously displayed.

I created some QSortFilterProxyModels to view parts of this model in other QTableViews : first issues arised here. It seems that the sortfilters do not always consider the records that are not yet fetched by the model but I dealt with that

Then, I need to procedurally update some SQL records. When I say procedurally, I mean that the data are modified with the code, not manually with the table view. For that, I need to check first if the record is in the table and there is my BIG problem:

Option 1: If I use the model to select the record with the expected ID (just to check whether it is present) then all the tableviews display the result of the select ... OK I can again select everything after that but this is a pain in the neck. In addition, it losts the tableview position and it is VERY slow (update of the views, rearragement of internal data ...) !!!

Option 2: If I create another model using the same SQL table just to look for a record and update it (as some sort of convenient database front end), everything seems to work fine but the updated record is never committed to the database even with submitall() calls. In addition, modifications made to this model are not always (but they are sometimes) applied to the other model.

My question is to know if there is an option 3 to have a simple and effective design enabling multiple different views of the same table, querying records with SQL requests, (I would like to avoid QSortFilterProxyModels, they are not convenient to use SQL like filtering) and procedural SQL queries at the same time.

Ideally I would like to create several QSQLTableModels and use their SQL request capabilities to filter the records. The only but critical issue is that they do not sync with database modifications and have problems to commit data when there are several refering to the same table... Is this normal because this is not how models should be used (I know a model should be unique, but QSQLTableModels have all the features I need) or is this a bug with SQLite ?

Any help will be greatly appreciated and I thank you for that in advance !

Cheers