I am not sure exactly, but we can get a signal when we move a scroll bar, I thought of doing it by catching that signal.
If it is not possible, You could suggest some other way as well :-)
@ChrisW67 : we have tried by applying filter on data base this is also taking much time, so I am searching for the solution (like lazy loading I want lazy filtering)
Where would you move the scrollbar if you don't know how many entries the model has? If the model filtered only until the view was populated with visible items the scroll bar would think there were no more items available and the scroll bar would not be visible.
1. Is it possible to call this function only for the items which are visible currently in a view & then when I scroll down Apply same filter for newly brought items into view ?
2. If it is not possible, You could suggest some other way as well :-)
Yes. Subclass QAbstractProxyModel and implement your own proxy.
Yes, you are not lazy loading the top level items, only their children. So you have more than 2 million items loaded into an in-memory model... That it takes some time to filter 2 million records using a brute force approach on un-indexed data through a generic interface is not surprising.The kind of lazy loading I am doing is different here
Filtering is the sort of thing that database engines do for a living and you should think about using that.
Bookmarks