There is a lineEdit needs to be done so that when you click on it, it is dropped, and you can enter a new text into it.
Here is my example, but there is a problem, I want to make one click, and it turns out only from the 2nd.
connect::(ui->lineEdit_password, SIGNAL(selectionChanged()), this, SLOT(clearPassword())); void MainWindow::clearPassword() { ui->lineEdit_password->clear(); ui->lineEdit_password->setEchoMode(QLineEdit::PasswordEchoOnEdit); ui->lineEdit_password->setReadOnly(0); }