Re: [Interest] unexpected result from QString::compare

2020-05-11 Thread Giuseppe D'Angelo via Interest
Il 11/05/20 10:23, Hamish Moffatt ha scritto: Q_GLOBAL_STATIC(QThreadStorage, defaultCollator) Why does it need an instance per thread? Because QCollator is reentrant, not thread-safe. HTH, -- Giuseppe D'Angelo | giuseppe.dang...@kdab.com | Senior Software Engineer KDAB (France) S.A.S., a KDA

Re: [Interest] unexpected result from QString::compare

2020-05-11 Thread Hamish Moffatt
On 9/5/20 12:35 am, Thiago Macieira wrote: On Friday, 8 May 2020 05:05:43 PDT Hamish Moffatt wrote: localeAwareCompare() is working as expected. Unfortunately, it doesn't allow the case sensitivity to be specified (unlike QCollator::compare() and QString::compare()), which makes it less us

Re: [Interest] unexpected result from QString::compare

2020-05-08 Thread Thiago Macieira
On Friday, 8 May 2020 05:05:43 PDT Hamish Moffatt wrote: > On 8/5/20 6:54 pm, Florian Bruhin wrote: > > On Fri, May 08, 2020 at 08:51:19AM +, Hamish Moffatt wrote: > >> On 8/5/20 5:13 pm, Fabrice Mousset | GEOCEPT GmbH wrote: > >>> Perhaps you should use QString::localeAwareCompare() ? > >> >

Re: [Interest] unexpected result from QString::compare

2020-05-08 Thread Hamish Moffatt
On 8/5/20 6:54 pm, Florian Bruhin wrote: On Fri, May 08, 2020 at 08:51:19AM +, Hamish Moffatt wrote: On 8/5/20 5:13 pm, Fabrice Mousset | GEOCEPT GmbH wrote: Perhaps you should use QString::localeAwareCompare() ? Thanks, I didn't know about that. Maybe the QString::compare() documentatio

Re: [Interest] unexpected result from QString::compare

2020-05-08 Thread Florian Bruhin
On Fri, May 08, 2020 at 08:51:19AM +, Hamish Moffatt wrote: > On 8/5/20 5:13 pm, Fabrice Mousset | GEOCEPT GmbH wrote: > > Perhaps you should use QString::localeAwareCompare() ? > > > Thanks, I didn't know about that. Maybe the QString::compare() documentation > could mention it... From http

Re: [Interest] unexpected result from QString::compare

2020-05-08 Thread Hamish Moffatt
On 8/5/20 5:13 pm, Fabrice Mousset | GEOCEPT GmbH wrote: Perhaps you should use QString::localeAwareCompare() ? Thanks, I didn't know about that. Maybe the QString::compare() documentation could mention it... Hamish ___ Interest mailing list Int

Re: [Interest] unexpected result from QString::compare

2020-05-08 Thread Fabrice Mousset | GEOCEPT GmbH
Perhaps you should use QString::localeAwareCompare() ? BR Fabrice > -Ursprüngliche Nachricht- > Von: Interest Im Auftrag von Hamish > Moffatt > Gesendet: Freitag, 8. Mai 2020 08:27 > An: Qt Interest > Betreff: [Interest] unexpected result from QString::compare >

[Interest] unexpected result from QString::compare

2020-05-07 Thread Hamish Moffatt
I'm trying to sort a list of strings where umlauts are involved, and not getting the answer I expect from QString::compare(). My sample code is:         auto a = QStringLiteral("Äbc");         auto b = QStringLiteral("BCD");         auto c = a.compare(b);         qDebug() << a << b << c; This p