Qt 6.12 LTS is out! See what's new in the release
blog
QSqlTableModel with custom sql queries
General and Desktop
2
Posts
2
Posters
2.9k
Views
1
Watching
-
Hi,
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?
Thanking You,
Ras -
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.