TreeView with a QSortFilterProxyModel goes out of sync with the model data upon sort operations.
- The expansion state of a row doesn't change i.e. an item that was expanded before sorting might not be expanded after sorting. Instead another item that was put onto the previously expanded row will now appear expanded instead
- Sort only affects one column. The rest of the columns are untouched.
- Item children do not keep up with the sort and may appear under a wrong parent item after sort
This seems to be fixed by resetting the model property of TreeView.
Steps to reproduce the problem:
- Run the attached example
- Expand a few items & try sorting