Source Model
Folder_1
|->Item_1
|->Item_2
Folder_2
|->Item_3
|->Item_4
ProxyModel
Item_1
Item_2
Item_3
Item_4
So basically the parent indexes from the source model (Folder_1 and Folder_2) are not in the Proxy Model.
I want to apply a filter to the proxy model, in the filterAcceptsRow method I check if the entry should be accepted in the model by checking if the entry matches the filter. Every time the filter changes I emit a filterChanged signal that will trigger a InvalidateFilter call that (in theory) will invoke that filterAcceptsRow method. The problem I have is that in this case filterAcceptsRow will never be called for some reason.
Looking into other forums for people that had similar issues I came across this answer:
I just understood that filterAcceptsRow get invoked only if parent of index is displayed in proxy model. Oherwise proxy model thinks that it is not worth to insert row in proxy model.
So it is just how Qt handles that kind of situations.
Hope this clarifies the issue.
thanks!
Bookmarks