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
Forum Updated to NodeBB v4.3 + New Features

Caching QSqlQueries

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 178 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 3 Dec 2018, 20:14 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

    1/1

    3 Dec 2018, 20:14

    • Login

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