What is the best way to display a Join between 2 or 3 tables? QSqlQueryModel?
-
@jdent
Yes,QSqlQueryModel
is the way to do this.Don't know what you need an "example" for --- just call
setQuery()
with whatever query you want, presumably includingJOIN
(s), what else is there to say? If you really want do a Google forqsqlquerymodel join
and have a look through some of the matches. -
-
@jdent said in What is the best way to display a Join between 2 or 3 tables? QSqlQueryModel?:
Ok, I thought there was more explicit support for joins
Yes, there isn't :) Qt provides low-ish level support for database table access, nothing fancy, nothing for an arbitrary
JOIN
. The only "extra" is QSqlRelationalTableModel Class, which implements a specificJOIN
for a foreign key. There will be third-party code, e.g. KDAB, out there which builds another layer on top if you want it.