sorting by multiple column in QSqlRelationalTableModel
divaindie last edited by
basically i want achieve something similar to below sqlite command in "QSqlRelationalTableModel"
SELECT * FROM TABLE ORDER BY column1,column2 desc;
but the limitation of QSqlRelationalTableModel is that setsort() or sort() functions can sort by only one column.
How can i solve this issue?
JonB last edited by JonB
6 years ago
Sorting on multiple columns can, AFAIK, only be done using your own query, or using a custom subclass of QSortFilterProxyModel in which you reimplement bool lessThan(const QModelIndex& left, const QModelIndex& right) const.