/************************************************************************ * This file has been generated automatically from * * * * src/core/settings/qgssettingsentry.h * * * * Do not edit manually ! Edit header and run scripts/sipify.pl again * ************************************************************************/ class QgsSettingsEntryBase { %Docstring(signature="appended") Represent settings entry and provides methods for reading and writing settings values. Different subclasses are provided for different settings types with metainformations to validate set values and provide more accurate settings description for the gui. .. versionadded:: 3.20 %End %TypeHeaderCode #include "qgssettingsentry.h" %End %ConvertToSubClassCode if ( dynamic_cast< QgsSettingsEntryVariant * >( sipCpp ) ) sipType = sipType_QgsSettingsEntryVariant; else if ( dynamic_cast< QgsSettingsEntryString * >( sipCpp ) ) sipType = sipType_QgsSettingsEntryString; else if ( dynamic_cast< QgsSettingsEntryStringList * >( sipCpp ) ) sipType = sipType_QgsSettingsEntryStringList; else if ( dynamic_cast< QgsSettingsEntryBool * >( sipCpp ) ) sipType = sipType_QgsSettingsEntryBool; else if ( dynamic_cast< QgsSettingsEntryInteger * >( sipCpp ) ) sipType = sipType_QgsSettingsEntryInteger; else if ( dynamic_cast< QgsSettingsEntryDouble * >( sipCpp ) ) sipType = sipType_QgsSettingsEntryDouble; else if ( dynamic_cast< QgsSettingsEntryColor * >( sipCpp ) ) sipType = sipType_QgsSettingsEntryColor; else sipType = NULL; %End public: QgsSettingsEntryBase( const QString &key, const QString &pluginName, const QVariant &defaultValue = QVariant(), const QString &description = QString(), Qgis::SettingsOptions options = Qgis::SettingsOptions() ); %Docstring Constructor for QgsSettingsEntryBase. 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. The ``options`` arguments specifies the options for the settings entry. %End virtual ~QgsSettingsEntryBase(); QString key( const QString &dynamicKeyPart = QString() ) const; %Docstring Returns settings entry key. The ``dynamicKeyPart`` argument specifies the dynamic part of the settings key. %End QString key( const QStringList &dynamicKeyPartList ) const; %Docstring Returns settings entry key. The ``dynamicKeyParts`` argument specifies the list of dynamic parts of the settings key. %End bool keyIsValid( const QString &key ) const; %Docstring Returns ``True`` if the provided key match the settings entry. This is useful for settings with dynamic keys. For example this permits one to check that the settings key "NewsFeed/httpsfeedqgisorg/27/content" is valid for the settings entry defined with the key "NewsFeed/%1/%2/content" The ``key`` to check %End QString definitionKey() const; %Docstring Returns settings entry defining key. For dynamic settings it return the key with the placeholder for dynamic part included. For non-dynamic settings returns the same as :py:func:`~QgsSettingsEntryBase.key`. %End bool hasDynamicKey() const; %Docstring Returns ``True`` if a part of the settings key is built dynamically. %End bool exists( const QString &dynamicKeyPart = QString() ) const; %Docstring Returns ``True`` if the settings is contained in the underlying QSettings. The ``dynamicKeyPart`` argument specifies the dynamic part of the settings key. %End bool exists( const QStringList &dynamicKeyPartList ) const; %Docstring Returns ``True`` if the settings is contained in the underlying QSettings. The ``dynamicKeyParts`` argument specifies the list of dynamic parts of the settings key. %End void remove( const QString &dynamicKeyPart = QString() ) const; %Docstring Removes the settings from the underlying QSettings. The ``dynamicKeyPart`` argument specifies the dynamic part of the settings key. %End void remove( const QStringList &dynamicKeyPartList ) const; %Docstring Removes the settings from the underlying QSettings. The ``dynamicKeyParts`` argument specifies the list of dynamic parts of the settings key. %End QgsSettings::Section section() const; %Docstring Returns settings section. The settings section of the parent group is returned if available. %End virtual bool setVariantValue( const QVariant &value, const QString &dynamicKeyPart = QString() ) const /Deprecated/; %Docstring Set settings value. The ``value`` to set. The ``dynamicKeyPart`` argument specifies the dynamic part of the settings key. .. deprecated:: QGIS 3.26 use setVariantValuePrivate or an implementation setValue instead %End virtual bool setVariantValue( const QVariant &value, const QStringList &dynamicKeyPartList ) const /Deprecated/; %Docstring Set settings value. The ``value`` to set. The ``dynamicKeyParts`` argument specifies the list of dynamic parts of the settings key. .. deprecated:: QGIS 3.26 use setVariantValuePrivate or an implementation setValue instead %End QVariant valueAsVariant( const QString &dynamicKeyPart = QString() ) const; %Docstring Returns settings value with the ``dynamicKeyPart`` argument specifying the dynamic part of the settings key. %End QVariant valueAsVariant( const QStringList &dynamicKeyPartList ) const; %Docstring Returns settings value with the ``dynamicKeyPart`` argument specifying the dynamic part of the settings key. %End QVariant valueAsVariantWithDefaultOverride( const QVariant &defaultValueOverride, const QString &dynamicKeyPart = QString() ) const; %Docstring Returns settings value with a ``defaultValueOverride`` .. versionadded:: 3.26 %End QVariant valueAsVariantWithDefaultOverride( const QVariant &defaultValueOverride, const QStringList &dynamicKeyPartList ) const; %Docstring Returns settings value. The ``dynamicKeyPartList`` argument specifies the list of dynamic parts of the settings key. The ``defaultValueOverride`` argument if valid is used instead of the normal default value. .. versionadded:: 3.26 %End QVariant valueAsVariant( const QString &dynamicKeyPart, bool useDefaultValueOverride, const QVariant &defaultValueOverride ) const /Deprecated/; %Docstring Returns settings value with an optional default value override .. deprecated:: QGIS 3.26 use valueAsVariantWithDefaultOverride instead %End QVariant valueAsVariant( const QStringList &dynamicKeyPartList, bool useDefaultValueOverride, const QVariant &defaultValueOverride ) const /Deprecated/; %Docstring Returns settings value with an optional default value override .. deprecated:: QGIS 3.26 use valueAsVariantWithDefaultOverride instead %End QVariant defaultValueAsVariant() const; %Docstring Returns settings default value. %End virtual Qgis::SettingsType settingsType() const = 0; %Docstring Returns the settings entry type. %End QString description() const; %Docstring Returns the settings entry description. %End QVariant formerValueAsVariant( const QString &dynamicKeyPart ) const; %Docstring Returns the former value of the settings if it has been enabled in the options. Returns the current value (or default) if there is no former value. .. versionadded:: 3.26 %End QVariant formerValueAsVariant( const QStringList &dynamicKeyPartList ) const; %Docstring Returns the former value of the settings if it has been enabled in the options Returns the current value (or default) if there is no former value. .. versionadded:: 3.26 %End protected: bool setVariantValuePrivate( const QVariant &value, const QStringList &dynamicKeyPartList = QStringList() ) const; %Docstring Sets the settings value with a variant value. This should be called from any implementation as it takes care of actually calling QSettings .. versionadded:: 3.26 %End QStringList dynamicKeyPartToList( const QString &dynamicKeyPart ) const; %Docstring Transforms a dynamic key part string to list .. versionadded:: 3.26 %End }; template class QgsSettingsEntryByReference : QgsSettingsEntryBase { %Docstring(signature="appended") Base abstract class for settings entry which are passed by reference .. seealso:: :py:class:`QgsSettingsEntryBase` .. seealso:: :py:class:`QgsSettingsEntryByValue` .. versionadded:: 3.26 %End %TypeHeaderCode #include "qgssettingsentry.h" %End public: QgsSettingsEntryByReference( const QString &key, const QString &pluginName, const T &defaultValue, const QString &description = QString(), Qgis::SettingsOptions options = Qgis::SettingsOptions() ); %Docstring Constructor for QgsSettingsEntryByReference. 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. The ``options`` arguments specifies the options for the settings entry. %End virtual Qgis::SettingsType settingsType() const = 0; T value( const QString &dynamicKeyPart = QString() ) const; %Docstring Returns settings value. The ``dynamicKeyPart`` argument specifies the dynamic part of the settings key. The ``defaultValueOverride`` argument if valid is used instead of the normal default value. %End T value( const QStringList &dynamicKeyPartList ) const; %Docstring Returns settings value. The ``dynamicKeyPartList`` argument specifies the list of dynamic parts of the settings key. The ``defaultValueOverride`` argument if valid is used instead of the normal default value. %End T valueWithDefaultOverride( const T &defaultValueOverride, const QString &dynamicKeyPart = QString() ) const; %Docstring Returns the settings value with a ``defaultValueOverride`` and with an optional ``dynamicKeyPart`` %End T valueWithDefaultOverride( const T &defaultValueOverride, const QStringList &dynamicKeyPartList ) const; %Docstring Returns the settings value with a ``defaultValueOverride`` for the ``dynamicKeyPartList`` %End T value( const QString &dynamicKeyPart, bool useDefaultValueOverride, const T &defaultValueOverride ) const /Deprecated/; %Docstring Returns the settings value for the ``dynamicKeyPart`` and with a ``defaultValueOverride`` .. deprecated:: QGIS 3.26 use valueAsVariantWithDefaultOverride instead %End T value( const QStringList &dynamicKeyPartList, bool useDefaultValueOverride, const T &defaultValueOverride ) const /Deprecated/; %Docstring Returns the settings value for the ``dynamicKeyPartList`` and with a ``defaultValueOverride`` .. deprecated:: QGIS 3.26 use valueAsVariantWithDefaultOverride instead %End bool setValue( const T &value, const QString &dynamicKeyPart = QString() ) const; %Docstring Set settings value. The ``value`` to set. The ``dynamicKeyPart`` argument specifies the dynamic part of the settings key. %End bool setValue( const T &value, const QStringList &dynamicKeyPartList ) const; %Docstring Set settings value. The ``value`` to set. The ``dynamicKeyParts`` argument specifies the list of dynamic parts of the settings key. %End T defaultValue() const; %Docstring Returns settings default value. %End T formerValue( const QString &dynamicKeyPart = QString() ) const; %Docstring Returns the former value. Returns the current value (or default) if there is no former value. %End T formerValue( const QStringList &dynamicKeyPartList ) const; %Docstring Returns the former value Returns the current value (or default) if there is no former value. %End protected: bool setValuePrivate( const T &value, const QStringList &dynamicKeyPartList ) const; %Docstring Sets the settings value with an optional list of dynamic parts %End virtual T convertFromVariant( const QVariant &value ) const = 0; %Docstring Converts the variant value to the value type of the setting %End virtual QVariant convertToVariant( const T &value ) const; %Docstring Converts the value to a variant %End virtual bool checkValue( const T &value ) const; %Docstring Check if the value is valid %End }; template class QgsSettingsEntryByValue : QgsSettingsEntryBase { %Docstring(signature="appended") Base abstract class for settings entry which are passed by value .. seealso:: :py:class:`QgsSettingsEntryBase` .. seealso:: :py:class:`QgsSettingsEntryByReference` .. versionadded:: 3.26 %End %TypeHeaderCode #include "qgssettingsentry.h" %End public: QgsSettingsEntryByValue( const QString &key, const QString &pluginName, T defaultValue, const QString &description = QString(), Qgis::SettingsOptions options = Qgis::SettingsOptions() ); %Docstring Constructor for QgsSettingsEntryByValue. 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. The ``options`` arguments specifies the options for the settings entry. %End virtual Qgis::SettingsType settingsType() const = 0; T value( const QString &dynamicKeyPart = QString() ) const; %Docstring Returns settings value. The ``dynamicKeyPart`` argument specifies the dynamic part of the settings key. The ``defaultValueOverride`` argument if valid is used instead of the normal default value. %End T value( const QStringList &dynamicKeyPartList ) const; %Docstring Returns settings value. The ``dynamicKeyPartList`` argument specifies the list of dynamic parts of the settings key. The ``defaultValueOverride`` argument if valid is used instead of the normal default value. %End T valueWithDefaultOverride( T defaultValueOverride, const QString &dynamicKeyPart = QString() ) const; %Docstring Returns the settings value with a ``defaultValueOverride`` and with an optional ``dynamicKeyPart`` %End T valueWithDefaultOverride( T defaultValueOverride, const QStringList &dynamicKeyPartList ) const; %Docstring Returns the settings value with a ``defaultValueOverride`` for the ``dynamicKeyPartList`` %End T value( const QString &dynamicKeyPart, bool useDefaultValueOverride, T defaultValueOverride ) const /Deprecated/; %Docstring Returns the settings value for the ``dynamicKeyPart`` and with a ``defaultValueOverride`` .. deprecated:: QGIS 3.26 use valueWithDefaultOverride instead %End T value( const QStringList &dynamicKeyPartList, bool useDefaultValueOverride, T defaultValueOverride ) const /Deprecated/; %Docstring Returns the settings value for the ``dynamicKeyPartList`` and with a ``defaultValueOverride`` .. deprecated:: QGIS 3.26 use valueWithDefaultOverride instead %End bool setValue( T value, const QString &dynamicKeyPart = QString() ) const; %Docstring Set settings value. The ``value`` to set. The ``dynamicKeyPart`` argument specifies the dynamic part of the settings key. %End bool setValue( T value, const QStringList &dynamicKeyPartList ) const; %Docstring Set settings value. The ``value`` to set. The ``dynamicKeyParts`` argument specifies the list of dynamic parts of the settings key. %End T defaultValue() const; %Docstring Returns settings default value. %End T formerValue( const QString &dynamicKeyPart = QString() ) const; %Docstring Returns the former value Returns the current value (or default) if there is no former value. %End T formerValue( const QStringList &dynamicKeyPartList ) const; %Docstring Returns the former value Returns the current value (or default) if there is no former value. %End protected: virtual bool setValuePrivate( T value, const QStringList &dynamicKeyPartList ) const; %Docstring Sets the settings value with an optional list of dynamic parts %End virtual T convertFromVariant( const QVariant &value ) const = 0; %Docstring Converts the variant value to the value type of the setting %End virtual QVariant convertToVariant( T value ) const; %Docstring Converts the value to a variant %End virtual bool checkValue( T value ) const; %Docstring Check if the value is valid %End }; /************************************************************************ * This file has been generated automatically from * * * * src/core/settings/qgssettingsentry.h * * * * Do not edit manually ! Edit header and run scripts/sipify.pl again * ************************************************************************/