QGIS API Documentation  3.22.4-Białowieża (ce8e65e95e)
Public Member Functions | List of all members
QgsSettingsEntryString Class Reference

A string settings entry. More...

#include <qgssettingsentry.h>

Inheritance diagram for QgsSettingsEntryString:
Inheritance graph
[legend]

Public Member Functions

 QgsSettingsEntryString (const QString &key, const QString &pluginName, const QString &defaultValue=QString(), const QString &description=QString())
 Constructor for QgsSettingsEntryString. More...
 
 QgsSettingsEntryString (const QString &key, QgsSettings::Section section, const QString &defaultValue=QString(), const QString &description=QString(), int minLength=0, int maxLength=-1)
 Constructor for QgsSettingsEntryString. More...
 
QString defaultValue () const
 Returns settings default value. More...
 
int maxLength ()
 Returns the string maximum length. More...
 
int minLength ()
 Returns the string minimum length. More...
 
void setMaxLength (int maxLength)
 Set the string maximum length. More...
 
void setMinLength (int minLength)
 Set the string minimum length. More...
 
virtual SettingsType settingsType () const override
 Returns the settings entry type. More...
 
bool setValue (const QString &value, const QString &dynamicKeyPart=QString()) const
 Set settings value. More...
 
bool setValue (const QString &value, const QStringList &dynamicKeyPartList) const
 Set settings value. More...
 
QString value (const QString &dynamicKeyPart=QString(), bool useDefaultValueOverride=false, const QString &defaultValueOverride=QString()) const
 Returns settings value. More...
 
QString value (const QStringList &dynamicKeyPartList, bool useDefaultValueOverride=false, const QString &defaultValueOverride=QString()) 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

A string settings entry.

Since
QGIS 3.20

Definition at line 333 of file qgssettingsentry.h.

Constructor & Destructor Documentation

◆ QgsSettingsEntryString() [1/2]

QgsSettingsEntryString::QgsSettingsEntryString ( const QString &  key,
QgsSettings::Section  section,
const QString &  defaultValue = QString(),
const QString &  description = QString(),
int  minLength = 0,
int  maxLength = -1 
)

Constructor for QgsSettingsEntryString.

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. The minLength argument specifies the minimal length of the string value. The maxLength argument specifies the maximal length of the string value. By -1 the there is no limit

Definition at line 270 of file qgssettingsentry.cpp.

◆ QgsSettingsEntryString() [2/2]

QgsSettingsEntryString::QgsSettingsEntryString ( const QString &  key,
const QString &  pluginName,
const QString &  defaultValue = QString(),
const QString &  description = QString() 
)

Constructor for QgsSettingsEntryString.

This constructor is intended to be used from plugins.

The key argument specifies the key of the settings. The pluginName argument is inserted in the key after the section. The defaultValue argument specifies the default value for the settings entry. The description argument specifies a description for the settings entry.

Definition at line 280 of file qgssettingsentry.cpp.

Member Function Documentation

◆ defaultValue()

QString QgsSettingsEntryString::defaultValue ( ) const

Returns settings default value.

Definition at line 333 of file qgssettingsentry.cpp.

◆ maxLength()

int QgsSettingsEntryString::maxLength ( )

Returns the string maximum length.

By -1 there is no limitation.

Definition at line 358 of file qgssettingsentry.cpp.

◆ minLength()

int QgsSettingsEntryString::minLength ( )

Returns the string minimum length.

Definition at line 348 of file qgssettingsentry.cpp.

◆ setMaxLength()

void QgsSettingsEntryString::setMaxLength ( int  maxLength)

Set the string maximum length.

maxLength The string maximum length.

Definition at line 353 of file qgssettingsentry.cpp.

◆ setMinLength()

void QgsSettingsEntryString::setMinLength ( int  minLength)

Set the string minimum length.

minLength The string minimum length.

Definition at line 343 of file qgssettingsentry.cpp.

◆ settingsType()

QgsSettingsEntryBase::SettingsType QgsSettingsEntryString::settingsType ( ) const
overridevirtual

Returns the settings entry type.

Implements QgsSettingsEntryBase.

Definition at line 338 of file qgssettingsentry.cpp.

◆ setValue() [1/2]

bool QgsSettingsEntryString::setValue ( const QString &  value,
const QString &  dynamicKeyPart = QString() 
) const

Set settings value.

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

Definition at line 290 of file qgssettingsentry.cpp.

◆ setValue() [2/2]

bool QgsSettingsEntryString::setValue ( const QString &  value,
const QStringList &  dynamicKeyPartList 
) const

Set settings value.

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

Definition at line 299 of file qgssettingsentry.cpp.

◆ value() [1/2]

QString QgsSettingsEntryString::value ( const QString &  dynamicKeyPart = QString(),
bool  useDefaultValueOverride = false,
const QString &  defaultValueOverride = QString() 
) const

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 323 of file qgssettingsentry.cpp.

◆ value() [2/2]

QString QgsSettingsEntryString::value ( const QStringList &  dynamicKeyPartList,
bool  useDefaultValueOverride = false,
const QString &  defaultValueOverride = QString() 
) const

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 328 of file qgssettingsentry.cpp.


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