Results 1 to 2 of 2

Thread: Locale-aware QString::contains()

  1. #1
    Join Date
    Feb 2008
    Posts
    98
    Thanks
    2
    Thanked 24 Times in 24 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Locale-aware QString::contains()

    Is there some method similar to QString::contains() but comparing the strings in a locale-aware way (like QString::localeAwareCompare() does)?

    For example, QString a = "Mr. César". If I call a.contains("Cesar") it will return false because 'é' is not the same as 'e'. I need some method that considers 'é' the same as 'e' and does the same with other non-ASCII characters (ö==o, ł==l, æ==a, ø==o, etc.)

    I could implement such method myself but probably I wouldn't be considering all possible combinations.

    I want to use it in a proxy model in order to filter row that contain the text typed by the user.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,014 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Locale-aware QString::contains()

    I would be very surprised if such a method existed...
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. qstring::contains
    By the goat boy in forum Qt Programming
    Replies: 2
    Last Post: 14th August 2008, 07:42

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.