-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainwindow.h
70 lines (54 loc) · 1.64 KB
/
mainwindow.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
68
69
70
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include "classtable.h"
#include "link.h"
#include <QMainWindow>
#include <QJsonObject>
#include <QJsonArray>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow {
Q_OBJECT
friend class SettingWindow;
friend class ClassTable;
public:
explicit MainWindow(QWidget *parent = nullptr );
~MainWindow() override;
void showView();
int getMainHeight() const;
void setTableWeek( int week, QDate relativeDate );
void setTableWeek( int week );
void updateWeekLabel();
void setCourseList(const QJsonArray &); //设置courseList
void setUser_id(QString); //设置user_id
protected:
void resizeEvent( QResizeEvent *event ) override;
void paintEvent( QPaintEvent *event ) override;
/*
void mousePressEvent(QMouseEvent *event) override;
void mouseMoveEvent(QMouseEvent *event) override;
void mouseReleaseEvent(QMouseEvent *event) override;
*/
int titleBarHeight;
private slots:
//打开设置窗口SettingWindow的槽
void openSetting();
void on_addButton_clicked();
void addNewClass();
void addNewNote();
void on_leftWeekButton_clicked();
void on_rightWeekButton_clicked();
void fetch_courseList(); //从服务器上获取课程表并传递给setCourseList2();
void setCourseList2(QNetworkReply *); //把课表赋给courseList数据成员
private:
Ui::MainWindow *ui;
ClassTable *childTablePtr;
QPoint mouseLastPos;
bool mouseIsPressed = false;
QCursor mouseLastCursor;
QString user_id; //用户的id
QJsonArray courseList; //用户课程json数组
Link *link;
};
#endif // MAINWINDOW_H