InsertProxyModel::sort currently returns early if the sort column is invalid. This makes it impossible to disable the sorting on a source model once any has been applied. Usually I do something like ui->tableView->sortByColumn(-1, Qt::SortOrder::AscendingOrder) but that doesn't work when using with InsertProxyModel because the proxy prevents the sort call from getting to the source model..
This is undocumented behaviour. QStandardItemModel also returns if the column is invalid. I see however that what you are asking is technically valid for QSqlTableModel
Hello - first, thank you for the library.
InsertProxyModel::sort
currently returns early if the sort column is invalid. This makes it impossible to disable the sorting on a source model once any has been applied. Usually I do something likeui->tableView->sortByColumn(-1, Qt::SortOrder::AscendingOrder)
but that doesn't work when using with InsertProxyModel because the proxy prevents the sort call from getting to the source model..