Results 1 to 5 of 5

Thread: Filter a Filtered QSortFilterProxyModel !?

  1. #1
    Join Date
    Nov 2010
    Posts
    30
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Filter a Filtered QSortFilterProxyModel !?

    hi...

    i want to filter a filtered QSortFilterProxyModel..

    for example items such this :

    proxyModel items =
    "123a"
    "1234a"
    "12345"
    "1234567"
    "12345678a"
    ....
    result proxyModel->setFilterRegExp(regExp("12345")) =

    "12345"
    "1234567"
    "12345678a"

    now i want to filter just tree above item with proxyModel->setFilterRegExp(regExp("a"))

    i want the result just be "12345678a" no "1234a" and "12345678a"

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    4,136
    Thanks
    235
    Thanked 660 Times in 650 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: Filter a Filtered QSortFilterProxyModel !?

    So what are you asking for? The correct QRegExp to use? How to chain together multiple QSortFilterProxyModels? What?

  3. #3
    Join Date
    Nov 2010
    Posts
    30
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Filter a Filtered QSortFilterProxyModel !?

    So what are you asking for? The correct QRegExp to use? How to chain together multiple QSortFilterProxyModels? What?
    i want to have advansed search like google search.. and , or , unwanted word..

    for and i use this \bword1\b.+\bword2\b

    it just find :
    word1 some word2
    and not find :
    word2 some word1

    whereas i want to find both..

  4. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    4,136
    Thanks
    235
    Thanked 660 Times in 650 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: Filter a Filtered QSortFilterProxyModel !?

    Then you need to have a QRegExp that contains the logical OR of both forms of your search phrase:

    (word1 some word2) | (word2 some word1)

  5. #5
    Join Date
    Nov 2010
    Posts
    30
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Filter a Filtered QSortFilterProxyModel !?

    this way is good for just tow word :
    the code must be :
    (\bword1\b.+\bword2\b|\bword2\b.+\bword1\b)

    so for tree word :

    (\bword1\b.+\bword2\b.+\bword3\b|\bword1\b.+\bword 3\b.+\bword2\b|\bword2\b.+\bword3\b.+\bword1\b|\bw ord2\b.+\bword1\b.+\bword3\b|\bword3\b.+\bword2\b. +\bword1\b|\bword3\b.+\bword1\b.+\bword2\b)

    i think this way for tree or more word is not good..
    ..

Similar Threads

  1. Replies: 0
    Last Post: 8th March 2011, 12:58
  2. Replies: 0
    Last Post: 1st December 2010, 06:51
  3. WM_INPUT not being filtered by winEventFilter()
    By been_1990 in forum Qt Programming
    Replies: 1
    Last Post: 12th October 2010, 03:19
  4. Replies: 4
    Last Post: 20th September 2007, 13:11

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.