TextField {
id: textField2
x: 233
y: 211
text: qsTr("")
activeFocusOnPress :true
passwordCharacter: "*"
echoMode: TextField.Password//用来表示这是Password模式下我们可以利用passwordCharacter对输入的内容进行隐藏
placeholderText : "请输入密码 "
selectByMouse: true
}
我们可以通过echoMode来声明TextField控件的模式,这里指定的是TextField.Password,我们可以在 passwordCharacter中设置要显示的字符。
TextField.Normal 正常显示
TextField.Password 密码显示
TextField.NoEcho 不显示
TextField.PasswordEchoOnedit 输入时显示正常,输入完成后显示为密码
具体显示效果TextField.Password模式下