PDA

View Full Version : Proxy model invalidation after dataChanged() emit



lotek
2nd February 2011, 14:11
Hello,

It seems, that the proxy model does not invalidate the filter automatically when dataChanged() is emit by the model.
e.g. after removing an item from the model a neighbor items is shown twice in the proxy with filter set. (filterAcceptsRow() and lessThan() methods overwritten)
Any experiences in this area?
After calling invalidate() on proxy model everything works fine.

Pls. let me know if this is the normal behavior or I am doing something wrong.

THX

rain87
2nd February 2011, 14:26
Note: By default, the model does not dynamically re-sort and re-filter data whenever the original model changes. This behavior can be changed by setting the dynamicSortFilter property.seems your case

lotek
3rd February 2011, 12:21
Hi,

Thanks for the answer.
I've forgotten to write it; the setDynamicSortFilter propriety is set to true in the proxy (in c-tor), but not in the model. Hence the proxy shall filter and sort I think that it is correct.
Shall I set it also in the model?
The other thing is, that without invalidation proxy reacts "somehow" on the changes,
e.g. after insert rows everything works fine. Problems seem to occur when rows are removed.

I am grateful for further hints.