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. QSqlRelationalDelegate commit data behavior
QtWS25 Last Chance

QSqlRelationalDelegate commit data behavior

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 2.6k Views
  • 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.
  • M Offline
    M Offline
    mirshahabdin
    wrote on last edited by
    #1

    Hi all, I have a QTableView that gets its data from a QSqlRelationalTableModel. I have used QSqlRelationalDelegate as my delegate to be able to show the comboboxs in my table. I also set the edit strategy to manual so that I can submit the data when the user press a "submit" button. Now the problem is that unless the user hit the Return key the edited data would not be committed to the model. That means the changes would not be reflected to the database unless the user first hit Return and then press the "submit" button on the form. Would someone tell me is there any way to change this behavior of my delegate (commit the changes to the model for say just by clicking the "submit" button and not hitting Return) or do I need to implement my own delegate, please?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mirshahabdin
      wrote on last edited by
      #2

      I guess I can also get edited data from delegate editor and insert it into database with a qsqlquery. But I even can't access to the editor. Any idea?

      Thanks

      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