QLineEdit类自带public function : void setEchoMode(EchoMode) 以实现密码输入框效果。
我特意看了一下QTextEdit,并没有这个方法
void setEchoMode(EchoMode) 文档介绍
This property holds the line edit's echo mode.
The echo mode determines how the text entered in the line edit is displayed (or echoed) to the user.
The most common setting is Normal, in which the text entered by the user is displayed verbatim,
but QLineEdit also supports modes that allow the entered text to be suppressed or obscured: these include NoEcho, Password and PasswordEchoOnEdit.
The widget's display and the ability to copy or drag the text is affected by this setting.
By default, this property is set to Normal.