MauiMan

settingsstore.cpp
1#include "settingsstore.h"
2#include <QSettings>
3
4using namespace MauiMan;
6 ,m_settings(new QSettings(QStringLiteral("Maui"), QStringLiteral("MauiMan"), this))
7{
8}
9
10SettingsStore::~SettingsStore()
11{
12}
13
14QVariant SettingsStore::load(const QString &key, const QVariant &defaultValue)
15{
16 QVariant variant;
17
18 variant = m_settings->value(key, defaultValue);
19
20 return variant;
21}
22
23void SettingsStore::save(const QString &key, const QVariant &value)
24{
25 m_settings->setValue(key, value);
26}
27
29{
30 m_settings->beginGroup(module);
31}
32
34{
35 m_settings->endGroup();
36}
void save(const QString &key, const QVariant &value)
Save a conf value entry to the local file.
void beginModule(const QString &module)
Set up the module section to write to.
SettingsStore(QObject *parent=nullptr)
SettingsStore.
QVariant load(const QString &key, const QVariant &defaultValue)
Load the value of a conf entry, with a possible default value.
void endModule()
Finish writing or reading from a module section.
The MauiMan name-space contains all of the available modules for configuring the Maui Applications an...
void beginGroup(QAnyStringView prefix)
void endGroup()
void setValue(QAnyStringView key, const QVariant &value)
QVariant value(QAnyStringView key) const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 27 2024 11:50:41 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.