QRegularExpression limit line edit box to 1-50?
Solved
General and Desktop
-
Good day fellow QT'ers, been fooling around in QT Creator and am trying to limit a QLineEdit I have to only accept numbers between 1 to 50 with this:
QRegularExpression("[1-9]{0,1}")
Been reading up on the docs for QRegularExpression and don't see a way to limit it to 50 as I'm able to type up to 99. Any ideas?
Appreciate the help!
-
Use a QSpinBox, set min/max appropriately.
-
@Christian-Ehrlicher Cool I'll try that thanks