Results 1 to 11 of 11

Thread: filterAcceptRows() is being called for all the top level items in the tree.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: filterAcceptRows() is being called for all the top level items in the tree.

    Quote Originally Posted by DURGAPRASAD NEELAM View Post
    The kind of lazy loading I am doing is different here, I am not using a fetchMore concept at all.
    It doesn't really matter. What matters is what rowCount() returns. The filter proxy will go from 0 to rowCount()-1 rows.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  2. #2
    Join Date
    Jan 2013
    Location
    Bangalore
    Posts
    49
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: filterAcceptRows() is being called for all the top level items in the tree.

    Quote Originally Posted by wysota View Post
    It doesn't really matter. What matters is what rowCount() returns. The filter proxy will go from 0 to rowCount()-1 rows.
    yes, I got this point. but what I want is, is there any way to stop it and Apply filter on currently viewing items and then when I move my scroll bar down apply the same filter to this new items.

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: filterAcceptRows() is being called for all the top level items in the tree.

    Quote Originally Posted by DURGAPRASAD NEELAM View Post
    yes, I got this point. but what I want is, is there any way to stop it and Apply filter on currently viewing items and then when I move my scroll bar down apply the same filter to this new items.
    How would you determine the size of the scrollbar then?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  4. #4
    Join Date
    Jan 2013
    Location
    Bangalore
    Posts
    49
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: filterAcceptRows() is being called for all the top level items in the tree.

    Quote Originally Posted by wysota View Post
    How would you determine the size of the scrollbar then?
    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 )

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: filterAcceptRows() is being called for all the top level items in the tree.

    Quote Originally Posted by DURGAPRASAD NEELAM View Post
    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.
    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.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. #6
    Join Date
    Jan 2013
    Location
    Bangalore
    Posts
    49
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: filterAcceptRows() is being called for all the top level items in the tree.


    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 :-)

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: filterAcceptRows() is being called for all the top level items in the tree.

    Quote Originally Posted by DURGAPRASAD NEELAM View Post
    [SIZE=4]
    [B] 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 ?
    Yes. Subclass QAbstractProxyModel and implement your own proxy.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  8. #8
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: filterAcceptRows() is being called for all the top level items in the tree.

    The kind of lazy loading I am doing is different here
    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.

    Filtering is the sort of thing that database engines do for a living and you should think about using that.

Similar Threads

  1. Level of an item QStandardItemModel for tree
    By mqt in forum Qt Programming
    Replies: 1
    Last Post: 3rd October 2013, 09:21
  2. QTreeWidget::findItems only searches top level items ?
    By krisha in forum Qt Programming
    Replies: 3
    Last Post: 27th October 2011, 08:28
  3. Replies: 2
    Last Post: 9th June 2011, 11:20
  4. filterAcceptRows() is being called many times for same souceRow.
    By kaushal_gaurav in forum Qt Programming
    Replies: 2
    Last Post: 19th February 2009, 03:49
  5. Crash while checking the index is of particular level of a tree
    By kapil sharma in forum Qt Programming
    Replies: 1
    Last Post: 27th November 2008, 07:21

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.