-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuserinterface.h
More file actions
56 lines (43 loc) · 1.83 KB
/
userinterface.h
File metadata and controls
56 lines (43 loc) · 1.83 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
#ifndef USERINTERFACE_H
#define USERINTERFACE_H
#include <QMainWindow>
#include <QSqlDatabase>
#include <QSqlQueryModel>
#include "bookmanagement.h"
#include "bookdetail.h"
#include "announcementdetail.h"
namespace Ui {
class UserInterface;
}
class UserInterface : public QMainWindow
{
Q_OBJECT
public:
explicit UserInterface(QWidget *parent = nullptr);
~UserInterface();
void setUserID(QString userID); // 设置用户ID
private slots:
void on_tabWidget_tabBarClicked(int index);
void on_infoEditBtn_clicked();
void on_bookSearchBtn_clicked();
void on_orderSearchBtn_clicked();
void on_bookList_clicked(const QModelIndex &index);
void on_pushButton_2_clicked();
void on_announcementList_clicked(const QModelIndex &index);
private:
Ui::UserInterface *ui;
QSqlQueryModel *model; // 数据库模型
QString userID; // 用户ID
BookManagement *bookManagement;
BookDetail *bookDetail;
AnnouncementDetail *ad; // 公告详情界面
void pullBookInfoList(); // 拉取数据库所有书本信息
bool checkInput(); // 审查输入的个人信息
void modifyUserInfo(); // 修改个人信息
void getUserInfo(); // 获取个人信息
void searchAndShow(QWidget *inputUI, QWidget *showUI, SearchWay way); // 查询数据并显示到UI上
void getAnnouncementList(); // 获取公告列表
void showDetails(QString isbn); // 展示书本详情
void borrowBook(QString isbn); // 借阅图书
};
#endif // USERINTERFACE_H