I'm suppose to use the QLineEdit component to read "double" values from the keyboard. The program is suppose to pop-up an error window in case the user enters a non-digit value. And also, which function holds the value of the QLineEdit?
I'm suppose to use the QLineEdit component to read "double" values from the keyboard. The program is suppose to pop-up an error window in case the user enters a non-digit value. And also, which function holds the value of the QLineEdit?
Hi, you should use a QDoubleSpinBox instead of the QLineEdit, but in case you can't do that: the current text of the QLineEdit can be accessed by QLineEdit::text(), and you may want to look at QDoubleValidator.
Ginsengelf
Read the answer in the last thread you started on this exact topic.
If you must use a QLineEdit then QDoubleValidator will prevent (no error message) any character that cannot possibly be part of a number, and can tell you if what remains meets the other validation criteria. See this thread also.
Bookmarks