Thanks for the help. I've read up on mutable and tried all sorts of dirty workarounds that couldnt do it....

Now I am (back) to a more sensible approach I think: I set all top-level-items visible in filterAcceptsRow() and when rowsRemoved() is emitted I check whether a top-level remains empty to remove it then.

Unfortunately that doesnt work either... here's the code: (the slot is connected to rowsRemoved(..):
Qt Code:
  1. void rowsWereRemoved(const QModelIndex & parent, int start, int end)
  2. {
  3. if (parent != QModelIndex()) /// ! toplevel is being removed
  4. if (!hasChildren(parent))
  5. removeRow(parent.row(), parent.parent());
  6. }
To copy to clipboard, switch view to plain text mode 
It causes a segfault on filtering immediately leaving completely unusable dumps....
So far all my attempts segfault as soon as a row is removed Is there something fundamentally flawed with my syntax?

Thanks for your help!!