Unsolved QIntValidator for fixed value
I have below two conditions
- Validate the value in column of tree based on minumum and maximum range.
- Valdiate the value in column of tree based on some fixed.
So suppose minrange is 0 and maxrange is 24
and fixed value is 45.
so use can able to enter value between 0-24 and fixed value 45.
I am able to control for minimum and maximum range using QIntValidator.
But is there any way I can handle the same thing for fixed value using QIntValidator or any other way?
Just to make sure I understand, a value is deemed valid if it is between 0 and 24 (inclusive) or equal to 45. Is that correct?
QIntValidatordoesn’t support this. You’ll have to make your own validator. Writing a custom validator is trivial if you read the docs.
SGaist Lifetime Qt Champion last edited by
Out of curiosity, why is that fixed value outside of the range ? Also why so far from the range ?
@SGaist It is my requirement
@Kerndog73 oh means entirely writing a seperate class for this purpose