Hello everyone,
I'm tring to sort my data filled in a QTableView. Data are the result of a query.
For that, I've proceed like below :
Qt Code:
  1. QSqlQueryModel *modelAb = new QSqlQueryModel(this);
  2. modelAb ->setQuery(query, dbConnexion);
  3. while(modelAb->canFetchMore())
  4. modelAb->fetchMore();
  5.  
  6. QSortFilterProxyModel * mSortFilterModel = new QSortFilterProxyModel(this);
  7. mSortFilterModel->setDynamicSortFilter(true);
  8. mSortFilterModel->setSourceModel(modelAb);
  9. tabAbonne->setModel(mSortFilterModel);
  10. tabAbonne->setSortingEnabled(true);
To copy to clipboard, switch view to plain text mode 
My problem is that for some columns, sorting works fine but for the other is not working.
Can anyone help me to resolve this problem.
Best regards.