1
0
mirror of https://gitee.com/drabel/LibQQt.git synced 2025-01-04 10:18:44 +08:00
LibQQt/qqtpassworddialog.cpp
2017-08-13 18:27:13 +08:00

47 lines
1.3 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include "qqtpassworddialog.h"
#include "ui_qqtpassworddialog.h"
QQTPasswordDialog::QQTPasswordDialog(QWidget *parent) :
QQTDialog(parent),
ui(new Ui::QQTPasswordDialog)
{
ui->setupUi(this);
setAttribute(Qt::WA_DeleteOnClose, false);
/*
* 阻挡父亲窗口内其他控件除非本dialog关闭 show的功能强大起来 可以使用输入法
*/
setWindowModality(Qt::WindowModal);
ui->lineEdit_ssid_password->setEchoMode(QLineEdit::Password);
ui->pushButton_ssid_connect->setEnabled(false);
connect(ui->pushButton_ssid_connect, SIGNAL(clicked()), this, SLOT(connectClicked()));
connect(ui->lineEdit_ssid_password, SIGNAL(textChanged(QString)), SLOT(btnEnabled(QString)));
connect(ui->btnCancel, SIGNAL(clicked()), this, SLOT(reject()));
}
QQTPasswordDialog::~QQTPasswordDialog()
{
delete ui;
}
void QQTPasswordDialog::setWifiName(QString name)
{
ui->label_ssid_name->setText(name);
}
QString QQTPasswordDialog::wifiPwd()
{
return ui->lineEdit_ssid_password->text();
}
void QQTPasswordDialog::connectClicked()
{
emit connectClicked(ui->lineEdit_ssid_password->text());
accept();
}
void QQTPasswordDialog::btnEnabled(QString pas)
{
bool enable = pas.length()<8?false:true;
ui->pushButton_ssid_connect->setEnabled(enable);
}