Hi all!

I think this happens because QSqlTableModel will call setSort after setFilter and this produces an Error (the LIMIT clause must be after any sorting clauses).

As far as I know, the only solutions are:

  • Use QSqlQueryModel
  • Subclass QSqlTableModel and implement the function (e.g implement the setQuery function)


I hope this can help.