qtQLineEdit 账号密码框的设置

    xiaoxiao2022-07-06  201

    设置占位符

    ui->lineEdit->setPalaceholderText("QQ号/手机/邮箱");

    设置输入为黑点

    ui->lineEdit_2->setEchoMode(QLineEdit::Password);

    默认为:

    QLineEdit::Normal    0    Display characters as they are entered. This is the default.

    不要显示任何东西。这可能适用于密码长度都应该保密的密码。

    QLineEdit::NoEcho    1    Do not display anything. This may be appropriate for passwords where even the length of the password should be kept secret.

    显示与平台相关的密码掩码字符,而不是实际输入的字符。

    QLineEdit::Password    2    Display platform-dependent password mask characters instead of the characters actually entered.

    在编辑时按输入显示字符,否则按密码显示字符。

    QLineEdit::PasswordEchoOnEdit    3    Display characters as they are entered while editing otherwise display characters as with Password.

     

    最新回复(0)