forked from krogank9/WifiMouseServer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetpassworddialog.cpp
43 lines (37 loc) · 932 Bytes
/
setpassworddialog.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include "setpassworddialog.h"
#include "ui_setpassworddialog.h"
#include <QCloseEvent>
#include <QPushButton>
SetPasswordDialog::SetPasswordDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::SetPasswordDialog)
{
ui->setupUi(this);
}
SetPasswordDialog::~SetPasswordDialog()
{
delete ui;
}
void SetPasswordDialog::accept()
{
QMetaObject::invokeMethod(this->parent(), "setPassword", Q_ARG(QString, ui->setPasswordEdit->text()));
ui->setPasswordEdit->setText("");
this->hide();
}
void SetPasswordDialog::reject()
{
ui->setPasswordEdit->setText("");
this->hide();
}
void SetPasswordDialog::closeEvent(QCloseEvent *event)
{
event->ignore();
ui->setPasswordEdit->setText("");
this->hide();
}
void SetPasswordDialog::show()
{
QDialog::show();
ui->setPasswordEdit->setFocus(Qt::OtherFocusReason);
ui->setPasswordButtons->button(QDialogButtonBox::Ok)->setDefault(true);
}