Results 1 to 2 of 2

Thread: QSortFilterProxyModel and search

  1. #1
    Join Date
    Jul 2006
    Posts
    8
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default QSortFilterProxyModel and search

    Hi,

    i'm new to qt4's model/view programming and now i need some help with qsortfilterproxymodel.

    I'm implementing search function on a qsqltablemodel and want my users to search the whole model together, not a single column only.
    Therefore i call setFilterKeyColumn( -1 ) : and nothing happens. The original and the proxy model has exactly the same row count. If a filter column is set, everything works fine.

    So, what is the correct way to search/filter the whole model in one step?

    Thanks
    vr

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    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 and search

    I think you have to reimplement filterAcceptsRow() and do your own checking.

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

    vr (16th May 2007)

Similar Threads

  1. Google Custom Qt Search Engine
    By mderdem in forum General Discussion
    Replies: 0
    Last Post: 21st March 2007, 08:41
  2. Search box?
    By sdfisher in forum Qt Programming
    Replies: 2
    Last Post: 19th March 2007, 18:37
  3. How to search a string in xml file with Qt Dom classes
    By doganay44 in forum Qt Programming
    Replies: 2
    Last Post: 5th October 2006, 20:16
  4. The Methods of quick search...
    By Xagen in forum General Discussion
    Replies: 1
    Last Post: 27th February 2006, 19:09

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.