I have an QSqlQueryModel attached to QTableView and I would like to supprt multiple column sort meaning-- I would like to sort by column 1 then sort column 2 and so on

e.g.
unsorted table
3 | C
1 | B
1 | K
1 | A


sorted table

1 | A
1 | B
1 | C
3 | C
My table my contain millions of row

Now, how can implement this , should i go and write a custom filter derived from QSortFilterProxy or I would go and parsed the sql statement of my model and and order by accordingly, (the latter seems to be tough) or next to impossible since my user will input the sql statement....

I need your suggestion guys

baray98