Results 1 to 8 of 8

Thread: Help with Concept: Sorting/filtering TreeView & QAbstractItemModel and filtering

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2015
    Posts
    5
    Thanks
    1

    Default Help with Concept: Sorting/filtering TreeView & QAbstractItemModel and filtering

    Can someone help me present a list filtered by the column 1 of the TreeView and the Hierarchical AbstractItemModel?

    I am trying to present a list in the lowerleft of only items that are of Type VARIABLE or STRING BUILDER. I have attempted to use sortFilterProxyModel and am missing something. I guess it only works on items that match when their parent is rootnode.

    I have been beating my head against the wall on how to do this without making two seperate AbstractItem models and attempting to maintain the QmodelIndexes.

    myGui.jpg

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 453 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: Help with Concept: Sorting/filtering TreeView & QAbstractItemModel and filtering

    Quote Originally Posted by bpkelly View Post
    I guess it only works on items that match when their parent is rootnode
    No, the filter is applied recursively to all children. Please re-check the filter expression.
    When you know how to do it then you may do it wrong.
    When you don't know how to do it then it is not that you may do it wrong but you may not do it right.

Similar Threads

  1. [Q] sorting&filtering on sqlite with qte-4.7.2
    By jameslee in forum Qt Programming
    Replies: 0
    Last Post: 12th June 2013, 05:20
  2. Sorting and filtering sql data
    By kode in forum Newbie
    Replies: 2
    Last Post: 12th June 2013, 04:11
  3. Replies: 6
    Last Post: 19th June 2012, 15:07
  4. Key filtering
    By phillip_Qt in forum Qt Programming
    Replies: 2
    Last Post: 24th June 2010, 09:10
  5. filtering a TreeView from buttom to top
    By soul_rebel in forum Qt Programming
    Replies: 11
    Last Post: 23rd April 2008, 07:15

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.