-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainwindow.h
113 lines (88 loc) · 2.86 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include "Line.h"
#include "Order.h"
#include "Query.h"
#include "Station.h"
#include <QDateTime>
#include <QImageReader>
#include <QLabel>
#include <QMainWindow>
#include <QPalette>
#include <QRadioButton>
#include <QScrollArea>
#include <QStringListModel>
#include <QTimer>
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE
class MainWindow : public QMainWindow
{
Q_OBJECT
private:
QLabel* lbDateTimeDisplay;
// QPixmaps and QSizes for displaying maps
QPixmap map_RouteSelect;
QSize frameSize_RouteSelect;
QPixmap map_MainMenu;
QSize frameSize_MainMenu;
QPixmap map_StationQuery;
QSize frameSize_StationQuery;
void DisplayMap(QString mapFileName, QPixmap* pixmap, QScrollArea* scrollArea, QLabel* lbMap);
// InfoBar
enum infoType {
info = 1,
warning = 2,
error = 3,
};
QLabel* lbInfo;
void InfoBarSetUp();
void SetInfoType(infoType type);
void InfoBarClear();
void UpdateInfo(QString info, infoType type);
void UpdateTotalPrice();
QTimer *countDownTimer;
int countDownSeconds;
/// @brief 清空站点查询界面输入的内容
void ClearStationQuery();
void DisplayQueryResult(QStringListModel* model_QueryResult);
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
const QString stationListName = ":docs/resources/StationList.csv";
const QString fareListName = ":docs/resources/FareList.csv";
const QString mainMapFileName = ":/maps/resources/maps/MetroMap.jpg";
Order *order;
private slots:
void on_btnStart_Welcome_clicked();
void on_actReturnHome_triggered();
/// @brief 更新日期时间
void updateDateTime();
void on_btnReturn_MainMenu_clicked();
void on_btnGoToMap_clicked();
void on_btnGoToPurchase_MainMenu_clicked();
void on_btnNext_RouteSelect_clicked();
void on_btnReturn_Checkout_clicked();
void on_btnGoToPurchase_StationQuery_clicked();
void on_radioLine_clicked();
void on_radioMap_clicked();
void on_listView_Start_RouteSelect_clicked(const QModelIndex &index);
void on_listView_Destination_RouteSelect_clicked(const QModelIndex &index);
void on_lineEdit_Start_RouteSelect_textChanged(const QString &arg1);
void on_lineEdit_Destination_RouteSelect_textChanged(const QString &arg1);
void SetNumOfTickets_btn();
void on_spinBox_NumOfTickets_valueChanged(int arg1);
void on_btn_Cash_clicked();
void on_btn_WeChatPay_clicked();
void on_btn_AliPay_clicked();
void on_btn_DCEP_clicked();
void InsertCash();
void on_price_or_cash_changed();
void on_btn_FinishPay_clicked();
void CountDown_FinishPay();
void on_btnStartQuery_clicked();
void on_listView_StationLines_clicked(const QModelIndex &index);
private:
Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H