QGIS API Documentation  3.24.2-Tisler (13c1a02865)
Public Member Functions | List of all members
QgsSettingsEntryEnumFlag< T > Class Template Reference

A template class for enum and flag settings entry. More...

#include <qgssettingsentry.h>

Inheritance diagram for QgsSettingsEntryEnumFlag< T >:
Inheritance graph
[legend]

Public Member Functions

 QgsSettingsEntryEnumFlag (const QString &key, QgsSettings::Section section, const T &defaultValue, const QString &description=QString())
 Constructor for QgsSettingsEntryEnumFlagBase. More...
 
defaultValue () const
 Returns settings default value. More...
 
virtual QgsSettingsEntryBase::SettingsType settingsType () const override
 Returns the settings entry type. More...
 
bool setValue (const T &value, const QString &dynamicKeyPart=QString()) const
 Set settings value. More...
 
bool setValue (const T &value, const QStringList &dynamicKeyPartList) const
 Set settings value. More...
 
value (const QString &dynamicKeyPart=QString(), bool useDefaultValueOverride=false, const T &defaultValueOverride=T()) const
 Returns settings value. More...
 
value (const QStringList &dynamicKeyPartList, bool useDefaultValueOverride=false, const T &defaultValueOverride=T()) const
 Returns settings value. More...
 
- Public Member Functions inherited from QgsSettingsEntryBase
 QgsSettingsEntryBase (const QString &key, const QString &pluginName, const QVariant &defaultValue=QVariant(), const QString &description=QString())
 Constructor for QgsSettingsEntryBase. More...
 
 QgsSettingsEntryBase (const QString &key, QgsSettings::Section section, const QVariant &defaultValue=QVariant(), const QString &description=QString())
 Constructor for QgsSettingsEntryBase. More...
 
virtual ~QgsSettingsEntryBase ()
 Destructor for QgsSettingsEntryBase. More...
 
QVariant defaultValueAsVariant () const
 Returns settings default value. More...
 
QString definitionKey () const
 Returns settings entry defining key. More...
 
QString description () const
 Returns the settings entry description. More...
 
bool exists (const QString &dynamicKeyPart=QString()) const
 Returns true if the settings is contained in the underlying QSettings. More...
 
bool exists (const QStringList &dynamicKeyPartList) const
 Returns true if the settings is contained in the underlying QSettings. More...
 
bool hasDynamicKey () const
 Returns true if a part of the settings key is built dynamically. More...
 
QString key (const QString &dynamicKeyPart=QString()) const
 Returns settings entry key. More...
 
QString key (const QStringList &dynamicKeyPartList) const
 Returns settings entry key. More...
 
bool keyIsValid (const QString &key) const
 Returns true if the provided key match the settings entry. More...
 
void remove (const QString &dynamicKeyPart=QString()) const
 Removes the settings from the underlying QSettings. More...
 
void remove (const QStringList &dynamicKeyPartList) const
 Removes the settings from the underlying QSettings. More...
 
QgsSettings::Section section () const
 Returns settings section. More...
 
virtual bool setVariantValue (const QVariant &value, const QString &dynamicKeyPart=QString()) const
 Set settings value. More...
 
virtual bool setVariantValue (const QVariant &value, const QStringList &dynamicKeyPartList) const
 Set settings value. More...
 
QVariant valueAsVariant (const QString &dynamicKeyPart=QString(), bool useDefaultValueOverride=false, const QVariant &defaultValueOverride=QVariant()) const
 Returns settings value. More...
 
QVariant valueAsVariant (const QStringList &dynamicKeyPartList, bool useDefaultValueOverride=false, const QVariant &defaultValueOverride=QVariant()) const
 Returns settings value. More...
 

Additional Inherited Members

- Public Types inherited from QgsSettingsEntryBase
enum class  SettingsType : int {
  Variant , String , StringList , Bool ,
  Integer , Double , EnumFlag , Color
}
 Types of settings entries. More...
 

Detailed Description

template<typename T>
class QgsSettingsEntryEnumFlag< T >

A template class for enum and flag settings entry.

Note
This template class has a dedicated handling in sipify.pl
Since
QGIS 3.20

Definition at line 883 of file qgssettingsentry.h.

Constructor & Destructor Documentation

◆ QgsSettingsEntryEnumFlag()

template<typename T >
QgsSettingsEntryEnumFlag< T >::QgsSettingsEntryEnumFlag ( const QString &  key,
QgsSettings::Section  section,
const T &  defaultValue,
const QString &  description = QString() 
)
inline

Constructor for QgsSettingsEntryEnumFlagBase.

The key argument specifies the final part of the settings key. The section argument specifies the section. The defaultValue argument specifies the default value for the settings entry. The description argument specifies a description for the settings entry.

Note
The enum needs to be declared with Q_ENUM, and flags with Q_FLAG (not Q_FLAGS).
for Python bindings, a custom implementation is achieved in Python directly

Definition at line 898 of file qgssettingsentry.h.

Member Function Documentation

◆ defaultValue()

template<typename T >
T QgsSettingsEntryEnumFlag< T >::defaultValue ( ) const
inline

Returns settings default value.

Definition at line 949 of file qgssettingsentry.h.

◆ settingsType()

template<typename T >
virtual QgsSettingsEntryBase::SettingsType QgsSettingsEntryEnumFlag< T >::settingsType ( ) const
inlineoverridevirtual

Returns the settings entry type.

Implements QgsSettingsEntryBase.

Definition at line 1025 of file qgssettingsentry.h.

◆ setValue() [1/2]

template<typename T >
bool QgsSettingsEntryEnumFlag< T >::setValue ( const T &  value,
const QString &  dynamicKeyPart = QString() 
) const
inline

Set settings value.

The value to set. The dynamicKeyPart argument specifies the dynamic part of the settings key.

Definition at line 979 of file qgssettingsentry.h.

◆ setValue() [2/2]

template<typename T >
bool QgsSettingsEntryEnumFlag< T >::setValue ( const T &  value,
const QStringList &  dynamicKeyPartList 
) const
inline

Set settings value.

The value to set. The dynamicKeyParts argument specifies the list of dynamic parts of the settings key.

Definition at line 994 of file qgssettingsentry.h.

◆ value() [1/2]

template<typename T >
T QgsSettingsEntryEnumFlag< T >::value ( const QString &  dynamicKeyPart = QString(),
bool  useDefaultValueOverride = false,
const T &  defaultValueOverride = T() 
) const
inline

Returns settings value.

The dynamicKeyPart argument specifies the dynamic part of the settings key. The useDefaultValueOverride argument specifies if defaultValueOverride should be used. The defaultValueOverride argument if valid is used instead of the normal default value.

Definition at line 914 of file qgssettingsentry.h.

◆ value() [2/2]

template<typename T >
T QgsSettingsEntryEnumFlag< T >::value ( const QStringList &  dynamicKeyPartList,
bool  useDefaultValueOverride = false,
const T &  defaultValueOverride = T() 
) const
inline

Returns settings value.

The dynamicKeyParts argument specifies the list of dynamic parts of the settings key. The useDefaultValueOverride argument specifies if defaultValueOverride should be used. The defaultValueOverride argument if valid is used instead of the normal default value.

Definition at line 930 of file qgssettingsentry.h.


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