[Qt-interest] QIntValidator not working as expected
Pradeep K Vijayan
pradeep.vijayan at gmail.com
Fri Sep 24 13:50:40 CEST 2010
Hi,
0 is allowed because appending few numbers after 0 makes the entry
valid. For ex, 0001 is a valid number in your case. Empty text and 0 in
your lineedit puts the validator in 'Intermediate' state.
http://doc.trolltech.com/4.7/qintvalidator.html#validate
Regards,
Pradeep K Vijayan
On 24/09/2010 12:23, Aaron Lewis wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
> Using an instance of QLineEdit as s3 , would range its value from
> 1 to 254 , thus
>
> ui->s3->setValidator(new QIntValidator(1,254,ui->s3));
>
> I could still type `000' inside the box , what could be wrong here ?
>
> Many thanks.
>
> - --
> Best Regards,
> Aaron Lewis - PGP: 0x4A6D32A0
> FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
> irc: A4R0NL3WI5 on freenode
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.16 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAkycikYACgkQvf41sEptMqAMAwCeP7xjJYQOqT+pojx+vycVoO90
> u88AoNBWsxHpHuCDpi2Q5SnnHHwUQSVv
> =XO5T
> -----END PGP SIGNATURE-----
More information about the Qt-interest-old
mailing list