vezzon
vezzon

Reputation: 209

Update related table in QSqlRelationalTableModel

I have a QSqlRelationalTableModel like this:

rel_model = QSqlRelationalTableModel(self, connectDB)
rel_model.setTable("main_table")
rel_model.setRelation(1, QSqlRelation("linked_table", "id", "name"))
rel_model.select()

But now the data in the linked_table changed (e.g. a row is added). How can I update the relation to use the modified data of the linked_table.

Note: I don't want to use rel_model.select(), because some data in the main_table were modified too, and they would be discarded then. I am using a SQlite-Database.

Upvotes: 0

Views: 174

Answers (0)

Related Questions