-
Notifications
You must be signed in to change notification settings - Fork 0
/
widget.h
107 lines (102 loc) · 3 KB
/
widget.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
#ifndef WIDGET_H
#define WIDGET_H
#include <QWidget>
#include <QGuiApplication>
#include <QNativeGestureEvent>
#include "settingwidget.h"
#include "myfiledialog.h"
#include "api.h"
#include "xlsxdocument.h"
class Widget : public QWidget
{
Q_OBJECT
public:
enum ThemeType
{
Dark,
Light,
System
};
enum FileDialogType
{
QtDialog,
MyDialog
};
enum InfoType
{
Global,
Personal
};
Widget(QWidget *parent = nullptr);
~Widget();
bool eventFilter(QObject *watched, QEvent *event);
#if (QT_VERSION >= QT_VERSION_CHECK(6,0,0))
bool nativeEvent(const QByteArray &eventType, void *message, qintptr *result);
#else
bool nativeEvent(const QByteArray &eventType, void *message, long *result);
#endif
static Widget* getCurrentWindow();
signals:
void systemThemeChanged();
void androidConfigurationChanged();
void qtMessageUpdated(QtMsgType type, const QMessageLogContext& context, const QString& msg);
void error(QString message);
private slots:
void initSettings(bool clear = false);
void readSettings();
void refreshUI();
void showTypeManager();
void createProject();
void openProject(QString filePath = QString(),bool needPassword = true);
void loadFileList();
void closeCurrentProject();
void showEditDialog(InfoType type,int personIndex = -1);
void loadInfoTable();
void processArguments();
QStringList showEditStringListDialog(QStringList list,bool isEditMode = true,bool hideModeBox = false);
int getTypeIndexFromKey(QString key);
int getTypeIndexFromName(QString name);
void removeProjectFilter();
void infoTableClicked(int y,int x);
void showAutoChangeDialog();
QStringList getTypeInfo(QString key);
QStringList getTypeInfo(QString key,InfoType filter);
int getPeopleCount();
ThemeType getApplicationTheme();
FileDialogType getApplicationFileDialogType();
private:
bool currentThemeisDark = false;
bool isMaximizedBeforeFullScreen = false;
int back_close_interval = 1000;
QList<QTime> back_press_timelist;
QString datapath;
QString settingpath;
QSettings* settings = nullptr;
QtMessageHandler defaultMessageHandler;
QStringList qtMsgList;
QFont defaultFont = QFont();
QPushButton* welcomebutton;
QPushButton* mainbutton;
QPushButton* settingbutton;
QPushButton* fullscreenbutton;
QWidget* welcomewidget;
QWidget* mainwidget;
SettingWidget* settingwidget;
SettingWidget* filelist;
QPushButton* openbutton;
QPushButton* newbutton;
QPushButton* closebutton;
QPushButton* typebutton;
QPushButton* showglobalbutton;
QPushButton* showpersonbutton;
QPushButton* closeprojectbutton;
QLineEdit* filteredit;
QRadioButton* casebutton;
QRadioButton* exactbutton;
QPushButton* autochangebutton;
QPushButton* outputbutton;
QPushButton* minimizebutton;
QTableWidget* infotable;
QSettings* project = nullptr;
};
#endif // WIDGET_H