-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSettings.cpp
More file actions
32 lines (25 loc) · 758 Bytes
/
Settings.cpp
File metadata and controls
32 lines (25 loc) · 758 Bytes
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
#include "Settings.hpp"
Settings::Settings(QObject *parent) : QObject(parent)
{
}
void Settings::setValue(const QString &key, const QString &value)
{
this->settings.setValue(key, value);
}
int Settings::getInt(const QString &key, int defaultValue)
{
return this->settings.value(key, defaultValue).toInt();
}
bool Settings::getBool(const QString &key, bool defaultValue)
{
return this->settings.value(key, defaultValue).toBool();
}
QLocale Settings::getLocale(const QString &key, QString defaultValue)
{
QString str_locale(this->settings.value(key, defaultValue).toString());
return QLocale(str_locale);
}
QString Settings::getString(const QString &key, const QString &defaultValue)
{
return this->settings.value(key, defaultValue).toString();
}