PDA

View Full Version : QRegExpValidator



vinaysagar
13th August 2014, 07:27
hi
i have a line edit which should accepts the values between 0.0 to 405.00
I tired it using QDoubleValidator which didnt work. i thought of using QRegExpValidator... i read the document regarding and
i found it was so confusing :confused:
can any one help me with the expression dat is used to set the required limit

Lesiok
13th August 2014, 08:20
What it means QDoubleValidator didnt work ?

vinaysagar
13th August 2014, 08:31
QDoubleValidator accepts the value out of range, it even accepts 999.


QDoubleValidator *val9 = new QDoubleValidator(0,405,1,this);

ui->lineEdit->setValidator(val9);
ui->lineEdit_2->setValidator(val9);

Lesiok
13th August 2014, 10:00
How about QDoubleSpinBox instead QLineEdit ?