Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
QSqlRelationalTable does not delete row in SQLite [SOLVED]
rutger last edited by
It took me a day to find out and look through the QSqlTableModel source code.
I had QSortFilterProxyModel working on a QSqlRelationalTableModel connected to a SQLite database. This database was a copy made with my own application from a MySQL database. When working on this copy SQLite database I found that the removeRows() was not working, the row was not deleted.
After a day struggling with Signal Spy and checking my own code for the deletion of the row I found my stupid error. In the SQLite database NO PRIMARY KEYS WERE SET! Without a primary key the removeRows() does not work.
Unfortunately this did not create an error message when debugging the application. The additional error message could be a suggestion for the developers of Qt.