-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmainwindow.h
More file actions
134 lines (110 loc) · 3.12 KB
/
mainwindow.h
File metadata and controls
134 lines (110 loc) · 3.12 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
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QtSql/QSql>
#include <QtSql/QSqlDatabase>
#include <QtSql/QSqlQuery>
#include <QtSql/QSqlError>
#include <QtSql/QSqlRecord>
#include <ActiveQt/QAxObject>
#include <ActiveQt/QAxBase>
#include <QFileInfo>
#include <QFileDialog>
#include <QTreeWidget>
#include <QTreeWidgetItem>
#include <QTableWidget>
#include <QTableWidgetItem>
#include <QMessageBox>
#include <QPushButton>
#include <QDialogButtonBox>
#include <QRegularExpression>
#include <QMap>
#include <QSpinBox>
#include <QDebug>
#include "searchdialog.h"
#include "connectiondialog.h"
#include "tableopt.h"
#include "help.h"
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private:
enum MainToolButton : int {
New = 0,
ImportFromTempDB,
Delete,
Show,
Search
};
enum SearchToolButton : int {
Start = 0,
Text,
Columns
};
struct Info
{
QString query;
int index = -1;
QVector<bool> mask;
};
Ui::MainWindow *ui;
QSqlDatabase myDB;
QSqlDatabase tempDB;
TableOpt *dbDialog;
ConnectionDialog *connectDialog;
Help *helpDialog;
QMap<QString, Info> infoMap;
QString *lastSelect;
QString *currentTable;
QVector<bool> currentMask;
bool simpleSearchDisplayed;
QRegularExpression *names;
QComboBox *searchBox;
QLineEdit *searchEdit;
QStringList* bases;
bool connectDB();
void showTable(QString table);
void drawHeaders(QSqlQuery query, QTableWidget *table, bool forSearch, QComboBox *serchCBox);
void drawRows(QSqlQuery query, QTableWidget *table, bool available);
void showMoreInfo(int row);
void hideColumnsFromMask(QVector<bool> mask);
void drawTree();
void getDateToTable(QString str, QComboBox* d, QComboBox* m, QSpinBox* y);
void getDateToForm(QString* str, QComboBox* d, QComboBox* m, QSpinBox* y);
private slots:
void clearMoreInfoForm();
void deleteThis();
void refreshTable();
void repeatLastSelect();
void selectedRowChanged(const QModelIndex current, const QModelIndex previous);
void changeTableMask();
void globalSearch();
void simpleSearch();
void setSearchActive();
void exportInExcel();
void exportInHtml();
void on_treeWidget_itemClicked(QTreeWidgetItem *item, int column);
void on_tableWidget_cellClicked(int row, int column);
void on_saveButton_clicked();
void on_addStudInGroup_clicked();
void on_addAssForGroup_clicked();
void on_addTeachForGroup_clicked();
void on_addDirectInAl_clicked();
void on_removeStudToGroup_clicked();
void showTempTable();
void showQtInfo();
void showLicense();
void showProgramInfo();
public slots:
void connectReconfigSlot();
void querySlot(QString);
void querySlot(QTableWidget* tableWidget, QString strQuery, bool mainDB);
void queriesSlot(QStringList qsl, bool mainDB);
};
#endif // MAINWINDOW_H