TheKedge
26th January 2006, 17:09
Qt4
I've got a QDoubleValidator on a QLineEdit as shown below
LineEdit = new QLineEdit;
LineEdit->setValidator(new QDoubleValidator(_MIN_BIAS_AMP, _MAX_BIAS_AMP, 2, LineEdit));//bottom, top, decimals, parent
where _MIN_... and _MAX are const doubles defined somewhere else.
Problem: The line edits allow input which is larger (or smaller) than the _MAX (_MIN). They (correctly) DON'T send the signal returnPressed() when the return key is pressed.
Example:
with
setValidator(new QDoubleValidator(-100.0, 100.0, 2, LineEdit));
I can type "1000000" or "-99999999" into the LineEdit. I thought that the Validator would not allow that.
I'm I missing a setting?
thanks
K
I've got a QDoubleValidator on a QLineEdit as shown below
LineEdit = new QLineEdit;
LineEdit->setValidator(new QDoubleValidator(_MIN_BIAS_AMP, _MAX_BIAS_AMP, 2, LineEdit));//bottom, top, decimals, parent
where _MIN_... and _MAX are const doubles defined somewhere else.
Problem: The line edits allow input which is larger (or smaller) than the _MAX (_MIN). They (correctly) DON'T send the signal returnPressed() when the return key is pressed.
Example:
with
setValidator(new QDoubleValidator(-100.0, 100.0, 2, LineEdit));
I can type "1000000" or "-99999999" into the LineEdit. I thought that the Validator would not allow that.
I'm I missing a setting?
thanks
K