Menu

[2edc72]: / settings.h  Maximize  Restore  History

Download this file

51 lines (42 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
50
#ifndef SETTINGS_H
#define SETTINGS_H
#include <qsettings.h>
#include <qstring.h>
#include <qstringlist.h>
#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 readNumValue (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 &);
QVariant localValue ( const QString &, const QString &, const QString &);
void setLocalValue (const QString &, const QString &, const QString &);
QString getDataXML (const QString &);
protected:
QStringList pathlist;
QStringList keylist;
QStringList 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.