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. Query regarding QSqlTableModel and delegate
Forum Updated to NodeBB v4.3 + New Features

Query regarding QSqlTableModel and delegate

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 185 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.
  • S Offline
    S Offline
    sunilpkd
    wrote on last edited by
    #1

    hi,
    I am doing one programme in native Qt. I have created Tableview with model as QSqlTableModel and delegate as a subclass of QItemDelegate. Along with that ,I have created SQLITE database with table assigning to QSqlTableModel. Initially it is displaying the data from the data bse table. Once I edit from the delegate, I have to update the database which is not happening properly.
    I have Delegate::setModelData() from here I will be calling model->setdata. If I want to implement the database submit function , where I need to implement the same? In the delegate class or in model class ? Please help me.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by SGaist
      #2

      Hi,

      What are you doing within your delegate ?

      By the way, you should rather use QStyledItemDelegate.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1

      • Login

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