I have a QLineEdit where the user should input only numbers.
QLineEdit
So is there a numbers-only setting for QLineEdit?
If you're using QT Creator 5.6 you can do that like this:
#include ui->myLineEditName->setValidator( new QIntValidator);
I recomend you put that line after ui->setupUi(this);
I hope this helps.