Mantid
Loading...
Searching...
No Matches
Namespaces | Functions
MantidQt::MantidWidgets::QSettingsHelper Namespace Reference

Namespaces

namespace  Detail
 

Functions

template<typename T >
T getSetting (QSettings const &settings, std::string const &settingGroup, std::string const &settingName)
 Loads an individual setting from disk.
 
template<typename T >
T getSetting (std::string const &settingGroup, std::string const &settingName)
 
template<typename T >
std::map< std::string, T > getSettingsAsMap (QSettings const &settings, std::string const &settingGroup)
 Loads a map of settings with the same type.
 
template<typename T >
std::map< std::string, T > getSettingsAsMap (std::string const &settingGroup)
 
template<typename T >
void setSetting (QSettings &settings, std::string const &settingGroup, std::string const &settingName, T const &value)
 Sets the value of a specified setting.
 
template<typename T >
void setSetting (std::string const &settingGroup, std::string const &settingName, T const &value)
 

Function Documentation

◆ getSetting() [1/2]

template<typename T >
T MantidQt::MantidWidgets::QSettingsHelper::getSetting ( QSettings const &  settings,
std::string const &  settingGroup,
std::string const &  settingName 
)

Loads an individual setting from disk.

Parameters
settingsThe settings store to read from
settingGroupThe name of the setting group
settingNameThe name of the setting
Returns
The value stored for the requested setting

Definition at line 41 of file QSettingsHelper.h.

References MantidQt::MantidWidgets::QSettingsHelper::Detail::qualifiedName().

◆ getSetting() [2/2]

template<typename T >
T MantidQt::MantidWidgets::QSettingsHelper::getSetting ( std::string const &  settingGroup,
std::string const &  settingName 
)

Definition at line 45 of file QSettingsHelper.h.

◆ getSettingsAsMap() [1/2]

template<typename T >
std::map< std::string, T > MantidQt::MantidWidgets::QSettingsHelper::getSettingsAsMap ( QSettings const &  settings,
std::string const &  settingGroup 
)

Loads a map of settings with the same type.

This comparison is required as QVariant types are not properly encoded in ini files

Parameters
settingsThe settings store to read from
settingGroupThe name of the setting group
Returns
A map of the values stored for all settings matching the given type

Definition at line 59 of file QSettingsHelper.h.

References name.

◆ getSettingsAsMap() [2/2]

template<typename T >
std::map< std::string, T > MantidQt::MantidWidgets::QSettingsHelper::getSettingsAsMap ( std::string const &  settingGroup)

Definition at line 79 of file QSettingsHelper.h.

◆ setSetting() [1/2]

template<typename T >
void MantidQt::MantidWidgets::QSettingsHelper::setSetting ( QSettings &  settings,
std::string const &  settingGroup,
std::string const &  settingName,
T const &  value 
)

Sets the value of a specified setting.

Parameters
settingsThe settings store to write to
settingGroupThe name of the setting group
settingNameThe name of the setting
valueThe value of the named setting

Definition at line 92 of file QSettingsHelper.h.

References name, MantidQt::MantidWidgets::QSettingsHelper::Detail::qualifiedName(), MantidQt::MantidWidgets::QSettingsChangeAware::setValue(), and value.

◆ setSetting() [2/2]

template<typename T >
void MantidQt::MantidWidgets::QSettingsHelper::setSetting ( std::string const &  settingGroup,
std::string const &  settingName,
T const &  value 
)