Results 1 to 5 of 5

Thread: Searching with QRefExp, Wildcards

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Searching with QRefExp, Wildcards

    Hi, a more sophisticated way to filter a list would be to use a QSortFilterProxyModel with QStringListModel and QListView. But with your code: First the slot receives ui->txtSearch->text() as a parameter, so there is no need to query it again. Inside the loop do something have a look at: QRegExp in general and specific QRegExp::exactMatch(), QRegExp::setPatternSyntax() with QRegExp::Wildcard.

  2. The following user says thank you to Lykurg for this useful post:

    deepal_de (7th June 2011)

Similar Threads

  1. Searching a QListWidget
    By bl1nk in forum Newbie
    Replies: 11
    Last Post: 9th August 2010, 21:54
  2. QAbstractListModel searching.
    By ComaWhite in forum Qt Programming
    Replies: 1
    Last Post: 15th June 2009, 18:41
  3. Searching in a list.
    By kaushal_gaurav in forum Qt Programming
    Replies: 4
    Last Post: 15th October 2008, 08:00
  4. searching in a TableWidget
    By peace_comp in forum Qt Programming
    Replies: 1
    Last Post: 17th May 2008, 16:17
  5. Searching a QTable
    By nategoofs in forum Qt Programming
    Replies: 1
    Last Post: 8th August 2007, 22:15

Tags for this Thread

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.