Hi everyone,

I'm using a QAbstractTableModel and a QSortFilterProxyModel with a tableview like this :

Qt Code:
  1. MyTableModel *model = new MyTableModel(searcher);
  2. MyQSortFilterProxyModel *proxyModel = new MyQSortFilterProxyModel();
  3. proxyModel->setSourceModel(model);
  4. ui->tableView->setModel(proxyModel);
To copy to clipboard, switch view to plain text mode 

When i click on a column header it is sorted but it's using the default comparison operator of the types used in the model.
I have a field representing an age in number of days but i display it in the tableview like "2 years".
I'm trying to get the proxy model to sort this column using the integer value and the tableview to display it using its string representation.

What would be the easiest way to obtain this behavior ?

Thank you.