According to it's documentation
If you can depend on Qt >= 5.10, then just use QSortFilterProxyModel::setRecursiveFilteringEnabled(true), and you don't need to use KRecursiveFilterProxyModel.
Can be deprecated now since KF5 doesn't support Qt 5.9 and older anymore.