Menu

[efa3d9]: / src / settings.h  Maximize  Restore  History

Download this file

50 lines (41 with data), 1.3 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
#ifndef SETTINGS_H
#define SETTINGS_H
#include <QSettings>
#include <QStringList>
#include "xmlobj.h"
// Some helper functions and simplified settings class
// to read and parse settings e.g. in undo/redo directories
class SimpleSettings {
public:
SimpleSettings();
~SimpleSettings();
void clear();
bool readSettings(const QString &);
void writeSettings(const QString &);
QString value(const QString &key, const QString &def = QString());
int numValue(const QString &, const int &def = 0);
void setValue(const QString &, const QString &);
private:
QStringList keylist;
QStringList valuelist;
};
// Overloaded QSettings class, used to save some settings in
// a map instead of users home directory
class Settings : public QSettings, public XMLObj {
public:
Settings();
Settings(const QString &, const QString &);
~Settings();
void clear();
void
clearLocal(const QString &filepath,
const QString &key); //! Clear keys starting with key in filepath
QVariant localValue(const QString &, const QString &, QVariant);
void setLocalValue(const QString &, const QString &, QVariant);
QString getDataXML(const QString &);
protected:
QStringList pathlist;
QStringList keylist;
QList<QVariant> valuelist;
};
#endif
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.