If I understand your question correctly, what you are saying is that if you return "false" for a certain row, then the children of that row are ignored, right? Unfortunately, that is how QSortFilterProxyModel works - as soon as one level of a tree returns false for filterAcceptsRow(), that row and all of its children are removed from further consideration.

Think about what it would mean if it didn't work that way and continued the recursion into children. What kind of tree would that result in? A bunch of children, but no parent for those children because the parent row had been rejected.

You probably need to rethink how you really want your filtering to work and maybe work out a few test cases by hand so you can get the logic right.