-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprofile.cpp
More file actions
43 lines (39 loc) · 1017 Bytes
/
Copy pathprofile.cpp
File metadata and controls
43 lines (39 loc) · 1017 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
35
36
37
38
39
40
41
42
43
#include "profile.h"
#include "ui_profile.h"
#include <QDate>
#include<QDebug>
#include<QString>
#include"mainpage.h"
#include<QMessageBox>
Profile::Profile(QWidget *parent,head user) :
QWidget(parent),
user(user),
ui(new Ui::Profile)
{
ui->setupUi(this);
QDate date = QDate::fromString(user->dob,"dd.MM.yyyy");
QString account = QString::number(user->account);
ui->dateEdit->setDate(date);
ui->name->setText(user->name);
ui->aadhar->setText(user->aadhar);
ui->account->setText(account);
ui->type->setText(user->account_type);
}
Profile::~Profile()
{
delete ui;
}
void Profile::on_save_clicked()
{
user->name = ui->name->text();
user->aadhar = ui->aadhar->text();
user->phone = ui->phone->text();
user->dob = ui->dateEdit->date().toString("dd.MM.yyyy");
QMessageBox::information(this,"Success","User details saved");
}
void Profile::on_mainmenu_clicked()
{
MainPage *mainpage = new MainPage(nullptr,user);
mainpage->show();
this->hide();
}