libQuotient
A Qt library for building matrix clients
Loading...
Searching...
No Matches
Quotient::SettingsGroup Class Reference

#include <settings.h>

Inheritance diagram for Quotient::SettingsGroup:
Collaboration diagram for Quotient::SettingsGroup:

Public Member Functions

 SettingsGroup (QString path, QObject *parent=nullptr)
 
Q_INVOKABLE bool contains (const QString &key) const
 
Q_INVOKABLE QVariant value (const QString &key, const QVariant &defaultValue={}) const
 
template<typename T >
T get (const QString &key, const T &defaultValue={}) const
 
Q_INVOKABLE QString group () const
 Get the path for this settings group.
 
Q_INVOKABLE QStringList childGroups () const
 
Q_INVOKABLE void setValue (const QString &key, const QVariant &value)
 
Q_INVOKABLE void remove (const QString &key)
 
- Public Member Functions inherited from Quotient::Settings
 Settings (QObject *parent=nullptr)
 
Q_INVOKABLE void setValue (const QString &key, const QVariant &value)
 Set the value for a given key.
 
Q_INVOKABLE void remove (const QString &key)
 Remove the value from both the primary and legacy locations.
 
Q_INVOKABLE QVariant value (const QString &key, const QVariant &defaultValue={}) const
 Obtain a value for a given key.
 
template<typename T >
T get (const QString &key, const T &defaultValue={}) const
 Obtain a value for a given key, coerced to the given type.
 
Q_INVOKABLE bool contains (const QString &key) const
 
Q_INVOKABLE QStringList childGroups () const
 Obtain the list of child groups from the current or, if missing, legacy settings.
 

Additional Inherited Members

- Static Public Member Functions inherited from Quotient::Settings
static void setLegacyNames (const QString &organizationName, const QString &applicationName={})
 Add a legacy organisation/application name to migrate settings from.
 
static QString escapedForSettings (QString key)
 Escape forward- and backslashes in keys because QSettings doesn't (see #842)
 
static QString unescapedFromSettings (QString key)
 Unescape \ and / in keys stored with escapedForSettings()
 
- Protected Attributes inherited from Quotient::Settings
QSettings legacySettings { legacyOrganizationName, legacyApplicationName }
 

Detailed Description

Definition at line 89 of file settings.h.

Constructor & Destructor Documentation

◆ SettingsGroup()

Quotient::SettingsGroup::SettingsGroup ( QString  path,
QObject *  parent = nullptr 
)
inlineexplicit

Definition at line 91 of file settings.h.

Member Function Documentation

◆ childGroups()

Q_INVOKABLE QStringList Quotient::SettingsGroup::childGroups ( ) const

◆ contains()

Q_INVOKABLE bool Quotient::SettingsGroup::contains ( const QString key) const

◆ get()

template<typename T >
T Quotient::SettingsGroup::get ( const QString key,
const T defaultValue = {} 
) const
inline

Definition at line 100 of file settings.h.

◆ group()

Q_INVOKABLE QString Quotient::SettingsGroup::group ( ) const

Get the path for this settings group.

Note
Unlike Settings::childGroups(), this function will not unescape group names under Accounts

◆ remove()

Q_INVOKABLE void Quotient::SettingsGroup::remove ( const QString key)

◆ setValue()

Q_INVOKABLE void Quotient::SettingsGroup::setValue ( const QString key,
const QVariant value 
)

◆ value()

Q_INVOKABLE QVariant Quotient::SettingsGroup::value ( const QString key,
const QVariant defaultValue = {} 
) const

The documentation for this class was generated from the following file: