ui->lineEdit->setEchoMode( QLineEdit::Password ); 转载于:https://www.cnblogs.com/Jim-william/p/5004729.html