Solved How to set displayText() on QlineEdit
-
I have been reading the QlineEdit documentation and I came accross with displayText() const property. I tried to use it, but with no success, the documentation does not show how to use it or gives an example. Does anyone know how to use it? I would like to show my lineEdit password on button click that EchoMode is Password. Thanks
-
Hi,
This properly won't help you, since as the description says, it will return a platform specific mask char if echo mode is password.
If you want to show the password you have to use the text property.
-
QLineEdit::displayText() only returns the currently displayed text. When you want to set the text in the QLineEdit you should use QLineEdit::setText()
/edit: one second too late :)
-
@SGaist and @Christian-Ehrlicher thanks for the clarification. I used setEchoMode to display the text