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 ...
...
QRegExp regExp
("[0-9]{1,1}|1[0-9]{1,1}|20");
...
...
QRegExp regExp("[0-9]{1,1}|1[0-9]{1,1}|20");
lineEdit_t1->setValidator(new QRegExpValidator(regExp, this));
...
To copy to clipboard, switch view to plain text mode
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
Bookmarks