-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdialog.cpp
More file actions
61 lines (55 loc) · 1.22 KB
/
Copy pathdialog.cpp
File metadata and controls
61 lines (55 loc) · 1.22 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
//This is the Dialog to add your modules information to be preprocessed into grades
#include "dialog.h"
#include "ui_dialog.h"
#include <QMessageBox>
Dialog::Dialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::Dialog)
{
ui->setupUi(this);
QList<QString> grades;
grades.append("Choose your grade");
grades.append("A+");
grades.append("A");
grades.append("A-");
grades.append("B+");
grades.append("B");
grades.append("B-");
grades.append("C+");
grades.append("C");
grades.append("D+");
grades.append("D");
grades.append("F");
ui->comboBox->addItems(grades);
}
QString Dialog::Module()
{
return ui->lineEdit->text();
}
int Dialog::Creditunits()
{
return ui->spinBox->value();
}
QString Dialog::Grade()
{
return ui->comboBox->currentText();
}
int Dialog::diffGrade()
{
return (ui->lineEdit_2->text()).toInt();
}
Dialog::~Dialog()
{
delete ui;
}
void Dialog::on_buttonBox_accepted()
{
if((ui->comboBox->currentText()=="Choose your grade" && diffGrade()==0)||Grade()==0||Module()==NULL){
QMessageBox::warning(this,"Incomplete","Please fill in the details correctly");
}
else accept();
}
void Dialog::on_buttonBox_rejected()
{
reject();
}