QSqlTableModel with custom sql queries
My application needs accessing two or more MySQL database tables, for reading and writing, with certain clauses. So I would like to know, how to do this? can I override SQL syntax for selecting and updating tables in QSqlTableModel?
First see if QSqlRelationalTableModel scratches your itch. Alternatively write your own QSqlQueryModel subclass that allows editing (see the query model example for a basic version).
You might also see if writing through a MySQL view is possible and, if so, can solve your problem.