Display “Error” in QLineEdit
Hi!
I´d like to display the word “Error” in color “red” in QLineEdit “edit2” if someone enters a number > 1 in QLineEdit “edit1”.
I tried:
- double number = edit1->text().toDouble(&ok);
- ...
- if(number > 1.0)
- {
- edit2->setText(error);
- }
- //Remark: edit1 and edit2 are introduced as pointers:
which didn´t work. If you see the problem, please tell!
4 replies
You must log in to post a reply. Not a member yet? Register here!


