QRegExp for validating a float entered ina lineEdit
Hi,
I want to read a number in the rangue [0; 20] with one "decimal" precision.
Examples:
0
1.5
12.4
14
20
I'm using ...
Code:
...
QRegExp regExp
("[0-9]{1,1}|1[0-9]{1,1}|20");
...
This validates integer only but is there a shorter way?
What if i want to extend it for the numbers in the example above?
I supose i could use input masks or something but i am trying the regular expressions.
Thanks
Re: QRegExp for validating a float entered ina lineEdit
Why not to use QDoubleValidator ?
Re: QRegExp for validating a float entered ina lineEdit
Because i didn't knew that one yet ;)
Thanks