PDA

View Full Version : QIntValidator



ChasW
12th February 2007, 19:57
Im trying to set a valid range for a line edit. The maximum value is being enforced, but the minimum value is not. i.e. it is allowing values less then 10 to be entered and stored.

How can I get the minimum value to be enfored?


QValidator *trackLineEditValidator = new QIntValidator(10, 255, this);
ui.trackLineEdit->setValidator(trackLineEditValidator);

Thank you,
Chas

jpn
12th February 2007, 20:01
Wouldn't spinbox be a better choice for that kind of numerical input? ;)

ChasW
12th February 2007, 20:36
Absolutely!