-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.h
77 lines (61 loc) · 2.1 KB
/
settings.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
/*
* @FilePath : \xjzer\settings.h
* @Description :
* @Author : Xjzer
* @Date : 2022-07-11 23:48:34
* @Email : [email protected]
* @Others : empty
* @LastEditTime : 2022-07-17 00:40:36
*/
#ifndef SETTINGS_H
#define SETTINGS_H
#include "type.h"
#include <QAbstractButton>
#include <QCheckBox>
#include <QComboBox>
#include <QDialog>
#include <QLabel>
#include <QLineEdit>
#include <QSettings>
#include <QSpinBox>
namespace Ui {
class settings;
}
class MainWindow;
class settings : public QDialog {
Q_OBJECT
public:
enum SettingsHandle {
LOAD = 0, /*load_setting_to_line_via_label*/
SAVE, /*save_setting_to_ini_via_label_and_line*/
};
explicit settings(QWidget *parent = nullptr);
friend class MainWindow;
~settings();
private slots:
void on_pushButton_odx_clicked();
void on_pushButton_dll_clicked();
void on_buttonBox_clicked(QAbstractButton *button);
void on_pushButton_genkey_clicked();
void on_pushButton_autotest_file_clicked();
void on_pushButton_create_test_ini_clicked();
void on_pushButton_create_edit_ini_clicked();
private:
void default_setting(void);
void restore_default_tab_address(void);
void restore_default_tab_uds(void);
void restore_default_tab_payload_item(void);
void tab_setting_load(int index);
void settings_handle(SettingsHandle handle, QLabel *label, QLineEdit *line);
void settings_handle(SettingsHandle handle, QLabel *label, QComboBox *comboBox);
void settings_handle(SettingsHandle handle, QCheckBox *checkBox, QLineEdit *line);
void settings_handle(SettingsHandle handle, QLabel *label, QSpinBox * spinBox);
void settings_handle(SettingsHandle handle, QString key, QSpinBox *spinBox); //spinBox作为value,绑定自定义key
void handle_setting_tab_address(SettingsHandle handle);
void handle_setting_tab_uds(SettingsHandle handle);
void handle_setting_tab_payload_item(SettingsHandle handle);
void handle_setting_tab_autotest_item(SettingsHandle handle);
Ui::settings *ui;
QSettings *m_settings;
};
#endif // SETTINGS_H