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. Does QSqlTableModel::select emit dataChanged/rowsInserted signals?

Does QSqlTableModel::select emit dataChanged/rowsInserted signals?

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 332 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.
  • Y Offline
    Y Offline
    yetanotherqtfan
    wrote on last edited by
    #1

    I modify database externally then call QSqlTableModel::select to reload the model. I expect dataChanged/rowsInserted signal emitted but it is actually not. How do I capture the information about the change of the database?

    JonBJ 1 Reply Last reply
    0
    • Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @yetanotherqtfan said in Does QSqlTableModel::select emit dataChanged/rowsInserted signals?:

      How do I capture the information about the change of the database?

      This only works when your driver supports QSqlDriver::EventNotifications - then you can connect to QSqlDriver::notification() which can be triggerd on insert/update/remove with a stored procedure.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      1
      • Y yetanotherqtfan

        I modify database externally then call QSqlTableModel::select to reload the model. I expect dataChanged/rowsInserted signal emitted but it is actually not. How do I capture the information about the change of the database?

        JonBJ Online
        JonBJ Online
        JonB
        wrote on last edited by
        #3

        @yetanotherqtfan said in Does QSqlTableModel::select emit dataChanged/rowsInserted signals?:

        then call QSqlTableModel::select to reload the model. I expect dataChanged/rowsInserted signal emitted but it is actually not.

        I thought (quite untested) that this would emit QAbstractItemModel::modelReset(), because it throws away all existing rows and starts again, so wouldn't bother with dataChanged/rowsInserted etc.?

        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