-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstudent.h
67 lines (50 loc) · 1.47 KB
/
student.h
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
62
63
64
65
66
67
#ifndef STUDENT_H
#define STUDENT_H
#include<QMap>
#include<QString>
#include<QDate>
class Course;
class StudentButton;
class Student
{
public:
Student();
Student(const QString& id, const QString& name, const QString& _class, const QString& phone, const QDate& birth, const QString& address);
~Student();
Student& operator=(const Student& src);
QMap<QString,int> course_list;//course数据的深拷贝
StudentButton* student_button;
int row;
int& operator[](const QString& course_id);
void setId(const QString& id);
void setName(const QString& name);
void setClass(const QString& _class);
void setPhone(const QString& phone);
void setBirth(const QDate& birth);
void setAddress(const QString& address);
void addCourse(const QString& course_id, int grade = 0);
void delCourse(const QString& course_id);
const QString& getId() const;
const QString& getName() const;
const QString& getClass() const;
const QString& getPhone() const;
const QDate& getBirth() const;
const QString& getAddress() const;
private:
QString id;
QString name;
QString _class;
QString phone;
QDate birth;
QString address;
};
#include <QPushButton>
class StudentButton : public QPushButton
{
Q_OBJECT
public:
Student* student;
explicit StudentButton(Student* student, QWidget *parent = nullptr);
signals:
};
#endif // STUDENT_H