Thanks for your response. But it doesn't work for me. I get no rows at all when I add LIMIT to the filter.
Thanks for your response. But it doesn't work for me. I get no rows at all when I add LIMIT to the filter.
You have to run a level 3 diagnostic.
Ashes to ashes, Qt to Qt ( wysota )
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.
Bookmarks