The latest change in QSortFilterProxyModel::setSourceModel() caused a regression bug which breaks QSortFilterProxyModel.
The offending commmit: http://code.qt.io/cgit/qt/qtbase.git/patch/?id=1c0fcbc887459d8963088309e83303eb1a7d2db0
The "destroyed()" signal of the old model is never disconnected. So after you set a new model and delete the old one, QSortFilterProxyModel:: is reset by the destroyed() signal emitted by the old model and the proxy model is broken.
The root cause is you called `_q_sourceModelDestroyed()` manually before calling base class `QAbstractProxyModel::setSourceModel()`, which resets d->model to the static empty model object. So in `QAbstractProxyModel::setSourceModel()`, the following line stop working since it disconnects from the static empty model instead of from the old model object. So the old model is never disconnected.
You can reproduce the bug easily with the test case I attached.
Related discussions in LXQt community: https://github.com/lxqt/libfm-qt/pull/197