We have a text-analysis application where the text being analyzed can be of any culture (English, Spanish, Thai, Arabic, etc.) Different cultures have different rules for strings: sorting, word breaks, determining which characters are the same, etc.
How do I make Qt container classes culture-aware? For example, if I am using QMap<QString, int>
, I want the keys to stay sorted based on the rules of a user-specified culture. (The culture is not necessary the same as the host OS.) Likewise, it should consider "duplicates" according to the rules of that culture.
In .Net, all such containers can be constructed with a culture-aware comparer such as IEqualityComparer<TKey>
. Is there an equivalent in Qt? If not, what workarounds exist?