changepassword.cpp
1.14 KB
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
44
45
46
47
#include "changepassword.h"
#include "ui_changepassword.h"
changePassword::changePassword(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::changePassword)
{
ui->setupUi(this);
}
changePassword::~changePassword()
{
delete ui;
}
bool changePassword::eventFilter(QObject *watched, QEvent *event)
{
if (watched==ui->input_passwd) //首先判断控件(这里指 lineEdit1)
{
if (event->type()==Qt::ClickFocus) //然后再判断控件的具体事件 (这里指获得焦点事件)
{
globaldata = "";
ui->input_passwd->setText("");
}
}
if (watched==ui->affirm_passwd) //首先判断控件(这里指 lineEdit1)
{
if (event->type()==Qt::ClickFocus) //然后再判断控件的具体事件 (这里指获得焦点事件)
{
globaldata = "";
ui->affirm_passwd->setText("");
}
}
}
void changePassword::on_input_passwd_textChanged(const QString &arg1)
{
globaldata = ui->input_passwd->text();
}
void changePassword::on_affirm_passwd_textChanged(const QString &arg1)
{
globaldata = ui->affirm_passwd->text();
}