-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmainwindow.cpp
More file actions
62 lines (44 loc) · 1.34 KB
/
mainwindow.cpp
File metadata and controls
62 lines (44 loc) · 1.34 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#include "mainwindow.h"
#include "./ui_mainwindow.h"
#include <QFileDialog>
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::on_actionOpen_triggered()
{
QString fileName = QFileDialog::getOpenFileName(this, "Open File", QString(), "Text Files (*.txt)");
}
void MainWindow::on_pushButton_Login_clicked(){
//here is test user data
QString uname = "test";
QString pwd = "test";
QString uv = "Northern University Bangladesh";
QString dept = "CSE";
QString dob = "04/12/03";
QString username = ui->lineEdit_username->text();
QString password = ui->lineEdit_password->text();
QLabel* msg = ui->label_message;
if(username == "" || password == ""){
msg->setText("<font color='red'>Username or password can't be empty!</font>");
return;
} else if (username == uname && password == pwd){
hide();
dashDialog = new DashDialog(this);
dashDialog->setData(uname, pwd, uv, dept, dob);
dashDialog->show();
} else {
msg->setText("<font color='red'>Username and passsword is incorrect</font>");
}
}
void MainWindow::on_createAccBtn_clicked(){
hide();
accCreation = new AccountCreation(this);
accCreation->show();
}