-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathmainwindow.cpp
68 lines (59 loc) · 1.43 KB
/
mainwindow.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "register.h"
#include "logging.h"
#include "mysql.h"
#include <QInputDialog>
MainWindow * MainWindow::MW=NULL;
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow *MainWindow::getIntance()
{
if(MW == NULL)
{
MW = new MainWindow();
}
return MW;
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::on_registerBtn_clicked()
{
this->hide();
Register *reg=new Register(this);
reg->setWindowTitle("注册");
reg->show();
}
void MainWindow::on_loginBtn_clicked()
{
this->hide();
logging *log=new logging(this);
log->setWindowTitle("登录");
log->show();
}
void MainWindow::on_forgetPasswdBtn_clicked()
{
bool ok;
QInputDialog ecf;
name = ecf.getText(this,tr("忘记密码"),tr("请输入用户名:"),QLineEdit::Normal,NULL,&ok);
identify=ecf.getText(this,tr("忘记密码"),tr("请输入证件号:"),QLineEdit::Normal,NULL,&ok);
MySql mysql;
bool ret=mysql.forgetpassward(name,identify);
if(!ret)
{
QMessageBox::information(this,tr("消息"),tr("消息不匹配!"),QMessageBox::Ok);
return;
}
QMessageBox::information(this,tr("消息"),tr("请妥善保管您的密码:%1").arg(passward),QMessageBox::Ok);
return;
}
void MainWindow::on_exitBtn_clicked()
{
this->close();
}