-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheditProfile.cpp
More file actions
34 lines (33 loc) · 870 Bytes
/
editProfile.cpp
File metadata and controls
34 lines (33 loc) · 870 Bytes
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 "editProfile.h"
#include"Home.h"
#include"database.h"
#include"qmessagebox.h"
editProfile::editProfile(Student* S,QWidget *parent)
: QWidget(parent)
{
ui.setupUi(this);
stud = S;
load();
}
void editProfile::load()
{
ui.lineEdit->setText(QString::fromStdString(stud->Name));
ui.lineEdit_2->setText(QString::fromStdString(stud->Password));
ui.lineEdit_3->setText(QString::number(stud->Academicyear));
}
editProfile::~editProfile()
{
}
void editProfile::on_pushButton_clicked()
{
QMessageBox::StandardButton save;
save = QMessageBox::question(this, "Save Info", "Save New Info?", QMessageBox::Yes | QMessageBox::No);
if (save == QMessageBox::Yes)
{
stud->Name = ui.lineEdit->text().toStdString();
stud->Password = ui.lineEdit_2->text().toStdString();
stud->Academicyear = ui.lineEdit_3->text().toInt();
Database::Save();
this->close();
}
}