-
Notifications
You must be signed in to change notification settings - Fork 0
/
verification.cpp
34 lines (31 loc) · 1002 Bytes
/
verification.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
#include "verification.h"
#include "ui_verification.h"
#include <QMessageBox>
#include <QDebug>
Verification::Verification(const QString &verificationCode, QWidget *parent)
: QDialog(parent)
, ui(new Ui::Verification)
, verificationCode(verificationCode)
{
ui->setupUi(this);
connect(ui->verifyCodeButton, &QPushButton::clicked, this, &Verification::on_verifyCodeButton_clicked);
qDebug()<<"code:" <<verificationCode;
}
Verification::~Verification()
{
delete ui;
}
bool Verification::on_verifyCodeButton_clicked()
{
QString code = ui->lineEdit->text();
if (code == verificationCode) {
QMessageBox::information(this, "Verification", "Verification successful!");
qDebug()<<"verification true";
accept();
// return true; // Close the dialog and return true
} else{
QMessageBox::warning(this, "Verification", "Verification failed. Please try again.");
qDebug()<<"verification false";
return false;
}
}