On quinta-feira, 23 de maio de 2013 17.13.59, Simon Lees wrote: > Hi All, > Seen as i don't have points to make doc notes or edit the wiki and > within 3 minutes of searching i couldn't find a easy way to reach the > doc team ill send this here. > > QLocale toInt in Qt 4 took a default paramater for base = 0, this means > that the default behavior is to handle the conversion as octal if there > is a leading 0 or has hex etc, etc. In our code we force base 10 because > the behavior of base 0 is undesirable for us. > In Qt5 QLocale does not have a paramater for base, it is also not > documented whether the conversion is handled as base 0 or 10. Having > spent 5 mins digging through source code i can confirm it is 10. It > would be nice if someone could update the porting guide and QLocale > documentation to mention this as it is a change of behavior that has > probably gone left unnoticed by alot of people although in my case i > think the Qt5 handling is more sensible.
Hi Simon Locale-based base encoding does not make sense. There's no language that does that, not even the "C" language speaks hexadecimal :-) But sure, the porting guide should be updated. I was working on this code in QLocale a month ago and I had not even realised that it had changed from Qt 4. Thanks for the heads-up. -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel Open Source Technology Center
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Development mailing list Development@qt-project.org http://lists.qt-project.org/mailman/listinfo/development