Hello,

I'm using a QSortFilterProxyModel in order to keep the rows of a tableview sorted by the values in the column 'index'.
When i change a value in the column 'index', the tableview is updated accordingly but the proxy model doesn't re-apply the sorting automatically.
However when i sort the column 'index' manually by clicking on its header once, then the proxy model updates itself for every future modification of values in the column, as i would like it to do.
So my question is : what happens when i click on the header of the column that i don't do programatically ?

Here is my code :

Qt Code:
  1. MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow)
  2. {
  3. ui->setupUi(this);
  4.  
  5. this->proxyModel = new QSortFilterProxyModel();
  6.  
  7. proxyModel->setSourceModel(model);
  8. proxyModel->setDynamicSortFilter(true);
  9. proxyModel->sort(0, Qt::AscendingOrder);
  10.  
  11. ui->tableView->setModel(proxyModel);
  12. ui->tableView->sortByColumn(0, Qt::AscendingOrder);
  13. }
To copy to clipboard, switch view to plain text mode 

Thank you.