Reputation: 48916
I have written the following part of a code that adds two numbers together and outputs the result:
QIntValidator *validator = new QIntValidator(0,50,this);
ui->firstNumber->setValidator(validator);
...
...
In this case, I get the following error:
CS2039: 'setValidator': is not a member of QTextEditor
How can I fix this problem?
Upvotes: 1
Views: 516
Reputation: 5718
Use a text input class that supports validation. You probably want QLineEdit
Upvotes: 1