Well,
Now I use this code:
ui.lineEdit->setValidator(myDblVal);
QDoubleValidator *myDblVal = new QDoubleValidator(-999.99, 999.99, 2, this);
myDblVal->setNotation(QDoubleValidator::StandardNotation);
ui.lineEdit->setValidator(myDblVal);
To copy to clipboard, switch view to plain text mode
If I change to Standard Notacion, QValidator works fine, but there is a bit problem.
As you can see in my example, my ranges are -999.00 - 999.99. Well, next step is to change this range, for example 0.00 - 1999.99.
After compile and execute new program, I advice that I can write values up to 1999.99 , for example 3999.89, BUT, I can not write values up to 9999.99. It seems that top range does not work fine, but avoid to write values up to 4 digits without decimals.
Bookmarks