-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainwindow.h
115 lines (93 loc) · 3.29 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
114
115
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QStandardItemModel>
#include <QStandardItem>
#include <QSqlTableModel>
#include <QSqlRelationalTableModel>
#include <QKeyEvent>
#include <QList>
#include <QListWidget>
#include <QProcess>
#include <QFileDialog>
#include <QFontDialog>
#include "learningdialog.h"
#include "questionsql.h"
#include "questionmovedialog.h"
#include "answereditdialog.h"
#include "settimedialog.h"
#include "htmltableadddialog.h"
#include "questiontageditdialog.h"
QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
void get_categoryItemTree(QStandardItem *parent, int parentId);
// void display_category_name();
void reload_categoryTreeView();
void save_answerList(int id);
void set_tableHeader();
void select_question_by_id(int id);
void update_count_categoryTreeView();
protected:
bool eventFilter(QObject *watched, QEvent *event);
private slots:
void on_categoryAddButton_clicked();
void on_categoryDelButton_clicked();
void on_categoryTreeView_clicked(const QModelIndex &index);
void category_item_change_handler(QStandardItem *item);
void on_categoryEditButton_clicked();
void on_questionAddButton_clicked();
void on_questionTextEdit_textChanged();
void on_questionTableView_clicked(const QModelIndex &index);
void on_questionDelButton_clicked();
void on_questionMoveButton_clicked();
void on_questionTableView_activated(const QModelIndex &index);
void on_answerAddButton_clicked();
void on_answerDelButton_clicked();
void on_answerEditButton_clicked();
void on_answerListWidget_itemDoubleClicked(QListWidgetItem *item);
void on_setGoodTimeButton_clicked();
void on_htmlTableAddButton_clicked();
void on_questionDirOpenButton_clicked();
void on_answerListRowsMoved(const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationRow);
void on_htmlImgAddButton_clicked();
//tag
void on_addTagButton_clicked();
void on_delTagButton_clicked();
void on_questionTagButton_clicked();
void on_tagTableView_activated(const QModelIndex &index);
void on_tagTableView_clicked(const QModelIndex &index);
//learn
void on_itemLearnButton_clicked();
void on_categoryLearnButton_clicked();
void on_categoryToLearnButton_clicked();
void on_speedLearnButton_clicked();
void on_questionTableView_pressed(const QModelIndex &index);
void on_questionTableView_entered(const QModelIndex &index);
void on_setFontButton_clicked();
private:
Ui::MainWindow *ui;
QuestionSql *questionSql;
QStandardItemModel *categoryItemModel;
QMap<int,QList<QStandardItem*>> categoryItemLists;
QSqlRelationalTableModel *questionTableModel;
bool is_questionTextEdit_editable = false;
QSqlTableModel *tagTableModel;
int currentSection;
QuestionMoveDialog *questionMoveDialog;
AnswerEditDialog *answerEditDialog;
LearningDialog *learningDialog;
SetTimeDialog *setTimeDialog;
HtmlTableAddDialog *htmlTableAddDialog;
QuestionTagEditDialog *questionTagEditDialog;
QDate currentDate;
};
#endif // MAINWINDOW_H