[Interest] Input Validator
Stephen King
Stephen.King at domino-uk.com
Thu Sep 18 09:20:52 CEST 2014
> Am 17.09.2014 17:11, schrieb Stephen King:
> > I'm a little confused with QML TextInput with an int validator in Qt
> > 4.7.4 (and maybe later). Given an int validator with a top of 128 and
> > bottom of -127, why is 07 acceptable but 08 not and likewise 028, 038
> > etc? I assume they're actually intermediate but I don't think I can
> > get that information from the QML.
> > [...]
>
> I'd assume that the zero at the left is interpreted as leading prefix for an octal
> number. That'll explain why 07 is accepted while 08 is not.
>
> Just for curiosity: is 0xf accepted? :-)
>
Yes, the base is being deduced from the number. It seems a fix was put in 4.8 on line 404 of qvalidator.cpp to always use base 10. This will work for me so I guess I'll just port that back to my 4.7.4 code.
Steve
This Email and any files transmitted with it are intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any reading, redistribution, disclosure or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you are not the intended recipient please contact the sender immediately and delete the material from your computer. E-mail may be susceptible to data corruption, interception, viruses and unauthorised amendment and Domino UK Limited<http://www.domino-printing.com/Channels/UK/eng/Home.aspx> does not accept liability for any such corruption, interception, viruses or amendment or their consequences.
Domino UK Limited<http://www.domino-printing.com/Channels/UK/eng/Home.aspx> Registered in England. Registered Number:1750201. Registered Office Address: Trafalgar Way, Bar Hill, Cambridge, CB23 8TU.
More information about the Interest
mailing list