[Development] QLocale work

John Layt jlayt at kde.org
Sun Jan 22 21:27:41 CET 2012


On Wednesday 18 Jan 2012 09:35:02 Thiago Macieira wrote:
> On Wednesday, 18 de January de 2012 00.47.31, John Layt wrote:
> > * QString will need a decision on the behaviour of toInt() / toLong() /
> > etc using the Default Locale.
> 
> They should use the C locale, not the Default (System) locale. Anything in
> QtCore, outside of QLocale, should default to the C locale unless otherwise
> explicitly requested. 
...
> This is a slightly behaviour-incompatible change, but one I feel is
> justified: reading / parsing of data with comma as a decimal separator was
> already broken, so we don't break it further; generating of data without
> thousands separators and with dots instead of commas for decimals is a
> minor inconvenience.

OK, patch in progress.  Currently these methods all fail on group separators 
due to the historic ambiguity, but now it is always C should we turn them back 
on, or just keep the backwards compatible behaviour?

> > QIntValidator & QDoubleValidator -  Very well behaved, only uses the
> > QLocalePrivate number methods and enums. You can set/get locale to use,
> > defaults to Default Locale but falls back to C Locale.
> 
> Falling back is a bad idea, unless a Nokian can dig up from the old history
> of that codebase a compelling reason why it was done like that.

OK, I'll post a patch.

John.




More information about the Development mailing list