On 24/05/13 14:07, [email protected] wrote: > Date: Thu, 23 May 2013 07:58:42 -0700 > From: Thiago Macieira<[email protected]> > Subject: Re: [Development] Undocumented change in behavior of QLocale > toInt() between Qt4 and Qt5 > To:[email protected] > Message-ID: <31941258.asBcdyDE2l@tjmaciei-mobl2> > Content-Type: text/plain; charset="us-ascii" > > 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:-)
I Agree, the reason i picked it up is because in our Qt4 code we had to force base 10 as it was desirable for us to have leading zero's in some cases. When porting i noticed the base was no longer there and went diging to figure out what it was. > > 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 _______________________________________________ Development mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/development
