-
Notifications
You must be signed in to change notification settings - Fork 1
/
settings.h
61 lines (52 loc) · 1.03 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
#ifndef SETTINGS_WINDOW_H
#define SETTINGS_WINDOW_H
#include <QtGui>
#include <QGridLayout>
#include <QCheckBox>
#include <QSettings>
#include <QMainWindow>
#include <QString>
#include <QMap>
QT_BEGIN_NAMESPACE
class QLabel;
class QCheckBox;
class QPushButton;
class QInputDialog;
QT_END_NAMESPACE
class ConfigLayout : public QGridLayout
{
Q_OBJECT
public:
ConfigLayout(QVariant *value, const QString &text);
private slots:
void setValue() const;
private:
QString text;
QLabel *valueLabel;
QVariant *value;
};
class ConfigCheckBox : public QCheckBox
{
Q_OBJECT
public:
ConfigCheckBox(QVariant *value, const QString &text);
private slots:
void setValue(int state) const;
private:
QVariant *value;
};
class SettingsWindow : public QWidget
{
Q_OBJECT
public:
SettingsWindow(QWidget *parent);
QMap<QString, QVariant> values;
void loadSettings();
void saveSettings();
protected:
void closeEvent(QCloseEvent *event);
private:
QSettings *settings;
QMainWindow *mainWindow;
};
#endif