Important: Please read the Qt Code of Conduct -

[SOLVED]How to update QSqlRelationalTableModel internal model?

  • Hi,

    I will try to explain the problem with the following scenario:

    Suppose we have two tables A and B, table B has a Foreign key column from A and we applied QSqlRelation to that column, now we insert/update a row in table A.

    The problem is that the QSqlRelation still see the old A table, how can i update the relation.?

    Appreciate any kind of help.

  • I tried to call myRelationalTableModel.relationModel(columnIndex).select() after saving changes to table A, but this doesn't solve the problem.

    Serious help needed, please.. :)

  • Help, Help, Help..!!!

    If this problem doesn't have a direct solution, please moderators just tell me..

  • Finally Solved,,

    it was a bug in PyQt4 until version 4.9.5-1, all you have to do is re-select the relation model, like this:


Log in to reply