Results 1 to 12 of 12

Thread: Proxymodel Sort , After Filter

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2014
    Posts
    43
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default Proxymodel Sort , After Filter

    Hi ,

    I am using QSortfilterProxyModel , And when i filter on any column in QTableView , I am calling setFilterRegExp(QString) .

    The Filter working fine , But when i try to sort other column after filter the data dissappear, My thougt the sort working on other column with given filter text .
    But i want to sort filtered data in all columns .Help Me anyone .

  2. #2
    Join Date
    Feb 2014
    Posts
    43
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default How to Apply Filter On Multiple Columns

    Hi ,

    I need multi column filter functionality , Means , I am using QSortFilterProxyModel, Suppose I have 50 rows of data , And When I filter on 1st column I got 20 rows of data , and When I filter on other column The data will filter from 20 rows data . Is it possible , If possible , can any one post the sample code .

    Thanks

  3. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Proxymodel Sort , After Filter

    You can always try to derive from QSortFilterProxyModel and implement filterAcceptsRow()

    Cheers,
    _

  4. #4
    Join Date
    Feb 2014
    Posts
    43
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default Re: Proxymodel Sort , After Filter

    You mean , can I customize QSortfilterproxymodel .

  5. #5
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Proxymodel Sort , After Filter

    Exactly.

    Cheers,
    _

Similar Threads

  1. Replies: 2
    Last Post: 10th September 2013, 10:37
  2. Replies: 0
    Last Post: 4th August 2013, 03:41
  3. TableView ProxyModel problem
    By poporacer in forum Newbie
    Replies: 11
    Last Post: 23rd August 2011, 04:08
  4. Replies: 19
    Last Post: 25th November 2010, 08:52
  5. ProxyModel problem
    By waynew in forum Qt Programming
    Replies: 1
    Last Post: 14th February 2010, 06:40

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.