Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. update()
Qt 6.12 LTS is out! See what's new in the release blog

update()

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 475 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.
  • D Offline
    D Offline
    Duy Khang
    wrote on last edited by Duy Khang
    #1

    how can i update data in table view when data on database changed ? Plz, help me.
    I use QSqlQueryModel

    JonBJ 1 Reply Last reply
    0
    • D Duy Khang

      how can i update data in table view when data on database changed ? Plz, help me.
      I use QSqlQueryModel

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @Duy-Khang
      Depends on whether by "when data on database changed" you mean you change it from within the same Qt program or you mean by some other external application.

      https://forum.qt.io/topic/91259/how-to-refresh-qsqlquerymodel mentions a couple of methods to refresh/rerun the query, if that is what you want to do manually.

      QSqlTableModel would allow you to update a table from your Qt code, and would "see" any changes done that way and bring the view back up to date.

      1 Reply Last reply
      0
      • D Offline
        D Offline
        Duy Khang
        wrote on last edited by
        #3

        okay, let me try this

        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
        • Unsolved