16 #include <QRegularExpression>
19 #include <QScopeGuard>
20 #include "../../util/btassert.h"
21 #include "../../util/btdebugonly.h"
26 auto groupGuard(QSettings & settings, QString
const & group) {
27 settings.beginGroup(group);
28 return qScopeGuard([&settings]() { settings.endGroup(); });
35 : m_state(std::move(state))
36 , m_groupPrefix(std::move(groupPrefix))
39 static QRegularExpression
const groupRegExp(
40 QStringLiteral(
"^([^/]+/)*$"));)
47 QVariant
const & defaultValue)
const
#define BT_DEBUG_ONLY(...)
std::shared_ptr< QSettings > m_state
void sync()
Synchronizes the configuration to disk.
void setValue_(QString const &key, QVariant value)
QStringList childKeys() const
void remove(QString const &key)
removes a key (and its children) from the current group.
QString m_groupPrefix
Empty or absolute path with trailing slash.
T value(QString const &key, T const &defaultValue=T()) const
Returns the settings value for the given global key.
QStringList childGroups() const
BtConfigCore(BtConfigCore &&)=default
QVariant qVariantValue(QString const &key, QVariant const &defaultValue=QVariant()) const
Returns the settings value for the given global key as a QVariant.
auto groupGuard(QSettings &settings, QString const &group)