How to make lineEdit acceptable only integers?
Unsolved
General and Desktop
-
Hi
You can use
http://doc.qt.io/qt-5/qintvalidator.html#details -
Hi,
depending on your needs an input-mask may help. This can be set inside designer. Look for Input-mask in the Documentation of QLineEdit. -
You can do something like this:
ui->yourLineEdit->setValidator( new QIntValidator(yourMin(0 for example), yourMax(100 for example), this) );
Here we have a qlineedit that will accept only integer from 0 to 100