The problem is that Qt uses inner join and you want to use outer join, so instead you can use QSqlTableModel (if you have a view) or QSqlQueryModel. In the latter case the model won't be editable and with view it depends on the underlying DBMS.
The problem is that Qt uses inner join and you want to use outer join, so instead you can use QSqlTableModel (if you have a view) or QSqlQueryModel. In the latter case the model won't be editable and with view it depends on the underlying DBMS.
I am also interested in this problem. But I dont understand the answer from jacek. Have someone solved this problem? Thanks.
By now, I will use a record with identifier 0 and empty description in my tables.
See this too:
http://www.qtcentre.org/forum/f-qt-p...del-12784.html
Auryn
Starting to learn the world of Qt
Hi,
I know this is an old thread, but you need to set the setJoinMode. By default the sqlRelationalTableModel uses an inner join. You need to set it to be a left join.
self.setJoinMode(QtSql.QSqlRelationalTableModel.Le ftJoin). This took me forever to figure out because the row would go into the database just not the view.
http://pyqt.sourceforge.net/Docs/PyQ...ml#setJoinMode
Bookmarks