-
Notifications
You must be signed in to change notification settings - Fork 0
/
course.h
58 lines (44 loc) · 1.36 KB
/
course.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
#ifndef COURSE_H
#define COURSE_H
#include<QList>
class Student;
class CourseButton;
class Course
{
public:
Course(const QString& id, const QString& name, int credit, const QString& term, const QString& classroom);
~Course();
QList<Student*> student_list;
Course& operator=(const Course& src);
Student* operator[](int n);
void setId(const QString& id);
void setName(const QString& name);
void setCredit(int credit);
void setTerm(const QString& term);
void setClassroom(const QString& classroom);
void addStudent(Student* student); //课程的student_lsit和学生的course_list都要添加
bool delStudent(Student* student); //删除应删除student_list的该学生,并删除该学生course_list的该course
void updateStudent(Student* student);
const QString& getId() const;
const QString& getName() const;
int getCredit() const;
const QString& getTerm() const;
const QString& getClassroom() const;
int row;
CourseButton* course_button;
private:
QString id;
QString name;
int credit;
QString term;
QString classroom;
};
#include <QPushButton>
class CourseButton : public QPushButton
{
public:
Course* course;
explicit CourseButton(Course* course, QWidget *parent = nullptr);
signals:
};
#endif // COURSE_H