Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Caching QSqlQueries
Qt 6.11 is out! See what's new in the release blog

Caching QSqlQueries

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 296 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jendker
    wrote on last edited by
    #1

    In order to allow caching the changes in QSqlRelationalTableModel i changed it's EditStrategy to OnManualSubmit, but at the same time I am using QSqlQueries to 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 with QSqlTableModel so I switched to work with table queries.

    Is there any neat way of caching QSqlQueries and 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?

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved