-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpass_dia.cpp
43 lines (35 loc) · 915 Bytes
/
pass_dia.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 "pass_dia.h"
#include "ui_pass_dia.h"
pass_dia::pass_dia(QWidget *parent) :
QDialog(parent),
ui(new Ui::pass_dia)
{
ui->setupUi(this);
setWindowTitle("رمز پویا");
setFixedSize(400,300);
t=new QTimer(this);
t->setInterval(1000);
connect(t,SIGNAL(timeout()),this,SLOT(timer_slot()));
t->start();
}
pass_dia::~pass_dia()
{
delete ui;
QString _pass=systemaccount->generatePassword();
}
void pass_dia::setsystemaccount(account* _account)
{
systemaccount=_account;
QString _pass=systemaccount->generatePassword();
ui->passprinter->setText(_pass);
}
void pass_dia::timer_slot()
{
if(ui->timer->value()==120)
{
ui->timer->reset();
QString _pass=systemaccount->generatePassword();
ui->passprinter->setText(_pass);
}
ui->timer->setValue(ui->timer->value()+1);
}