53007 修改wifi密码输入框为按下显示明文松开取消明文

This commit is contained in:
lvhan 2021-05-08 15:08:06 +08:00
parent d2ef240613
commit 200f394899
7 changed files with 50 additions and 32 deletions

View File

@ -841,13 +841,16 @@ bool OneConnForm::isWifiConfExist(QString netName)
} }
//设置密码隐藏或可见 //设置密码隐藏或可见
void OneConnForm::on_checkBoxPwd_stateChanged(int arg1) void OneConnForm::on_checkBoxPwd_pressed()
{ {
if (arg1 == 0) { ui->checkBoxPwd->setChecked(true);
ui->lePassword->setEchoMode(QLineEdit::Password); ui->lePassword->setEchoMode(QLineEdit::Normal);
} else { }
ui->lePassword->setEchoMode(QLineEdit::Normal);
} void OneConnForm::on_checkBoxPwd_released()
{
ui->checkBoxPwd->setChecked(false);
ui->lePassword->setEchoMode(QLineEdit::Password);
} }
void OneConnForm::on_lePassword_textEdited(const QString &arg1) void OneConnForm::on_lePassword_textEdited(const QString &arg1)

View File

@ -124,14 +124,16 @@ private slots:
void on_btnHideConn_clicked(); void on_btnHideConn_clicked();
void on_checkBoxPwd_stateChanged(int arg1);
void on_lePassword_textEdited(const QString &arg1); void on_lePassword_textEdited(const QString &arg1);
void on_btnInfo_clicked(); void on_btnInfo_clicked();
void on_btnCancel_clicked(); void on_btnCancel_clicked();
void on_checkBoxPwd_pressed();
void on_checkBoxPwd_released();
private: private:
QTimer *waitTimer = nullptr; QTimer *waitTimer = nullptr;
int waitPage; int waitPage;

View File

@ -148,13 +148,17 @@ void WiFiConfigDialog::toConfigWifi()
} }
} }
void WiFiConfigDialog::on_checkBoxPwd_stateChanged(int arg1) //切换密码明文
void WiFiConfigDialog::on_checkBoxPwd_pressed()
{ {
if (arg1 == 0) { ui->checkBoxPwd->setChecked(true);
ui->leWifiPassword ->setEchoMode(QLineEdit::Password); ui->leWifiPassword->setEchoMode(QLineEdit::Normal);
} else { }
ui->leWifiPassword->setEchoMode(QLineEdit::Normal);
} void WiFiConfigDialog::on_checkBoxPwd_released()
{
ui->checkBoxPwd->setChecked(false);
ui->leWifiPassword ->setEchoMode(QLineEdit::Password);
} }
void WiFiConfigDialog::on_leWifiId_textEdited(const QString &arg1) void WiFiConfigDialog::on_leWifiId_textEdited(const QString &arg1)

View File

@ -31,14 +31,16 @@ private slots:
void on_btnOk_clicked(); void on_btnOk_clicked();
void on_checkBoxPwd_stateChanged(int arg1);
void on_leWifiId_textEdited(const QString &arg1); void on_leWifiId_textEdited(const QString &arg1);
void on_leWiFiName_textEdited(const QString &arg1); void on_leWiFiName_textEdited(const QString &arg1);
void on_leWifiPassword_textEdited(const QString &arg1); void on_leWifiPassword_textEdited(const QString &arg1);
void on_checkBoxPwd_pressed();
void on_checkBoxPwd_released();
private: private:
Ui::WiFiConfigDialog *ui; Ui::WiFiConfigDialog *ui;
QGSettings *m_transparency_gsettings = nullptr; QGSettings *m_transparency_gsettings = nullptr;

View File

@ -504,14 +504,15 @@ void WpaWifiDialog::initConnect() {
//连接按钮 //连接按钮
connect(connectBtn, &QPushButton::clicked, this, &WpaWifiDialog::slot_on_connectBtn_clicked); connect(connectBtn, &QPushButton::clicked, this, &WpaWifiDialog::slot_on_connectBtn_clicked);
//显示密码 //显示密码
connect(pwdShowBtn, &QCheckBox::clicked, this, [ = ]() { connect(pwdShowBtn, &QCheckBox::pressed, this, [ = ]() {
if (pwdShowBtn->isChecked()) { pwdShowBtn->setChecked(true);
pwdEditor->setEchoMode(QLineEdit::Normal); pwdEditor->setEchoMode(QLineEdit::Normal);
m_pwd4PrivateKeyPWDEditor->setEchoMode(QLineEdit::Normal); m_pwd4PrivateKeyPWDEditor->setEchoMode(QLineEdit::Normal);
} else { });
pwdEditor->setEchoMode(QLineEdit::Password); connect(pwdShowBtn, &QCheckBox::released, this, [ = ]() {
m_pwd4PrivateKeyPWDEditor->setEchoMode(QLineEdit::Password); pwdShowBtn->setChecked(false);
} pwdEditor->setEchoMode(QLineEdit::Password);
m_pwd4PrivateKeyPWDEditor->setEchoMode(QLineEdit::Password);
}); });
connect(pwdEditor, &QLineEdit::textChanged, this, &WpaWifiDialog::slot_line_edit_changed); connect(pwdEditor, &QLineEdit::textChanged, this, &WpaWifiDialog::slot_line_edit_changed);
connect(userEditor, &QLineEdit::textChanged, this, &WpaWifiDialog::slot_line_edit_changed); connect(userEditor, &QLineEdit::textChanged, this, &WpaWifiDialog::slot_line_edit_changed);

View File

@ -340,13 +340,17 @@ void DlgHideWifiWpa::on_btnConnect_clicked()
// shellProcess->deleteLater(); // shellProcess->deleteLater();
//} //}
void DlgHideWifiWpa::on_checkBoxPwd_stateChanged(int arg1) //切换密码明文
void DlgHideWifiWpa::on_checkBoxPwd_pressed()
{ {
if (arg1 == 0) { ui->checkBoxPwd->setChecked(true);
ui->lePassword ->setEchoMode(QLineEdit::Password); ui->lePassword->setEchoMode(QLineEdit::Normal);
} else { }
ui->lePassword->setEchoMode(QLineEdit::Normal);
} void DlgHideWifiWpa::on_checkBoxPwd_released()
{
ui->checkBoxPwd->setChecked(false);
ui->lePassword->setEchoMode(QLineEdit::Password);
} }
void DlgHideWifiWpa::on_leNetName_textEdited(const QString &arg1) void DlgHideWifiWpa::on_leNetName_textEdited(const QString &arg1)

View File

@ -54,14 +54,16 @@ private slots:
void on_btnConnect_clicked(); void on_btnConnect_clicked();
void on_checkBoxPwd_stateChanged(int arg1);
void on_leNetName_textEdited(const QString &arg1); void on_leNetName_textEdited(const QString &arg1);
void on_lePassword_textEdited(const QString &arg1); void on_lePassword_textEdited(const QString &arg1);
// void finishedProcess(int res); // void finishedProcess(int res);
void on_checkBoxPwd_pressed();
void on_checkBoxPwd_released();
signals: signals:
void reSetWifiList(); void reSetWifiList();
void stopSignal(); void stopSignal();