Unfortunately QSqlTableModel has only one setQuery() method and it is this one: QSqlQueryModel::setQuery(const QSqlQuery &query).

What can I do?