Can’t save data with customised SQLRelationalTableModel
I’ve created a subclass of SQLRelationalTableModel and overridden selectStatement(). This is so that I can modify the select statement to convert integers to dates (I’m using SQLite).
This works fine, and it appears that I can update the view (QTableView) correctly
Unfortunately when I call submitAll() on my model I get the error “no such column: startDate) Unable to execute statement”.
The column in question is “employee.startDate”. How can I see the SQL statement that will be used to update my database? And how can I then modify it if necessary?
Jonathan: this is what I tried to warn you about on your original thread [developer.qt.nokia.com].
You may want to look into the source for the QSQLRelationTableModel to see how it works. I assume it can get the column name if you a query or may have issues dealing with different data types.