Results 1 to 2 of 2

Thread: [QSortFilterProxyModel] filtering depends on child element

  1. #1
    Join Date
    Sep 2007
    Posts
    29
    Thanks
    8

    Default [QSortFilterProxyModel] filtering depends on child element

    hello,
    i want to use a QSortFilterProxyModel to filter data according to it's elements sub-elements, so if element E has child C with value X = FORBIDDEN, element E has to be filtered out.
    the problem seems to be that filtering is done on the fly while inserting data into the source model, so when E is inserted, C doesn't exist yet and when C is inserted, you can't filter out E anymore.
    so, is there some good solution for that?
    sure, i could disable all the proxies while inserting data, but that seems to be rather ugly.

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

    Default Re: [QSortFilterProxyModel] filtering depends on child element

    You could filter out all elements that don't have children yet Or invalidate the filter when an item receives a child.

  3. The following user says thank you to wysota for this useful post:

    maximAL (10th January 2008)

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.