I'm afraid I don't understand what you mean. If you want to join two tables then that's not possible with QSqlRelationalTableModel. You can only substitute data from a column with data from some column from another table. To do more complex things you have to use QSqlQueryModel.