Results 1 to 2 of 2

Thread: How to update QSqlRelation

  1. #1
    Join Date
    Nov 2011
    Posts
    17
    Thanks
    1
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default How to update QSqlRelation

    Hi,

    I have a SQLite database with 4 tables in it. Table 2,3 and 4 are referenred to table 1 by foreign keys. My UI is made of four QTableViews with a QSqlRelationalTableMode in each of them.
    I use ItemDelegates to display only valid entries in table one, but if I change on of the foreign keys in table 2 - 4, the ItemDelegateComboxBoxes won´t be updated.

    Is there any way to update the ComboxBoxes or update the entire model, when I switch between my Table Views?

    Thanks in advance.

    Micha

  2. #2
    Join Date
    Nov 2011
    Posts
    17
    Thanks
    1
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: How to update QSqlRelation

    I solved the problem on my own. When I switch to the table view of table one, I reinitialize the model. That works perfekt.

Similar Threads

  1. Refresh QSqlRelation
    By Banjo in forum Qt Programming
    Replies: 3
    Last Post: 23rd May 2018, 10:39
  2. Replies: 2
    Last Post: 14th April 2015, 20:50
  3. [QSqlRelation] Is this possible?
    By mhbeyle in forum Qt Programming
    Replies: 3
    Last Post: 29th November 2009, 19:14
  4. Replies: 2
    Last Post: 22nd January 2009, 12:29
  5. Trouble with QSqlRelationalTableModel and QSqlRelation
    By yleesun in forum Qt Programming
    Replies: 0
    Last Post: 8th August 2008, 10:16

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.