Qt 6.11 is out! See what's new in the release
blog
Caching QSqlQueries
-
In order to allow caching the changes in
QSqlRelationalTableModeli changed it's EditStrategy toOnManualSubmit, but at the same time I am usingQSqlQueriesto update values of records or to copy the records.I was trying to work 100% on the models by getting the records (I can paste the exact code, but here it is for the brevity):
QSqlRecord record_basis = table_model->database().record(table_name); record.setValue(...); ... table_model->insertRecord(record );but it failed with the
QSqlRelationalTableModel, was workingo only fine withQSqlTableModelso I switched to work with table queries.Is there any neat way of caching
QSqlQueriesand executing them on submit? I guess no, because QSqlQueries work directly on the table, not on the model. Should I just create queue and call them one buy one before submit?