Results 1 to 2 of 2

Thread: QSql Model-View: How to keep view in sync with model

  1. #1
    Join Date
    Jan 2008
    Location
    Germany
    Posts
    80
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default QSql Model-View: How to keep view in sync with model

    Hi,

    I would like to do the following:

    One part of my application is using QSqlQuery to store datas in a database.
    An other part of my application is using QSqlTableModel to view the datas stored in the database.

    How can I get the view to be refreshed automatically when datas have been updated in the database (so that the view always show the live content of the database)?

    Thank you

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QSql Model-View: How to keep view in sync with model

    Unless you are using a database that supports notifications (like PostgreSQL), you have to take care about it manually.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.