PDA

View Full Version : Locale-aware QString::contains()



victor.fernandez
25th November 2009, 11:42
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.

wysota
25th November 2009, 18:58
I would be very surprised if such a method existed...