diff --git a/core/remote/serverproxymodel.h b/core/remote/serverproxymodel.h index aa8924279..3b6b59c14 100644 --- a/core/remote/serverproxymodel.h +++ b/core/remote/serverproxymodel.h @@ -22,6 +22,17 @@ #include namespace GammaRay { + +template void init(BaseProxy *) {} + +template<> inline void init(QSortFilterProxyModel *proxy) +{ + proxy->setRecursiveFilteringEnabled(true); +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + proxy->setAutoAcceptChildRows(true); +#endif +} + /** Sort/filter proxy model for server-side use to pass through extra roles in itemData(). * Every remoted proxy model should be wrapped into this template, unless you already have * a special implementation for itemData() handling this. @@ -35,6 +46,7 @@ class ServerProxyModel : public BaseProxy , m_sourceModel(nullptr) , m_active(false) { + init(this); } /** Additional roles used from the source model for transfer to the client. */