Class: QgsSettingsEntryByReferenceQColorBase

class qgis.core.QgsSettingsEntryByReferenceQColorBase

Bases: QgsSettingsEntryBase

Base abstract class for settings entry which are passed by reference

See also

QgsSettingsEntryByValue

New in version 3.26.

QgsSettingsEntryByReferenceQColorBase(name: str, parent: QgsSettingsTreeNode, defaultValue: Union[QColor, Qt.GlobalColor], description: str = ‘’, options: Union[Qgis.SettingsOptions, Qgis.SettingsOption] = Qgis.SettingsOptions()) Constructor for QgsSettingsEntryByReference.

Parameters:
  • name – specifies the key of the settings.

  • parent – specifies the parent in the tree of settings.

  • defaultValue – specifies the default value for the settings entry.

  • description – specifies a description for the settings entry.

  • options – specifies the options for the settings entry.

Raises:

QgsSettingsException – if the number of given parent named items doesn’t match the complete key definition

New in version 3.30.

QgsSettingsEntryByReferenceQColorBase(key: str, section: str, defaultValue: Union[QColor, Qt.GlobalColor], description: str = ‘’, options: Union[Qgis.SettingsOptions, Qgis.SettingsOption] = Qgis.SettingsOptions()) Constructor for QgsSettingsEntryByReference.

Parameters:
  • key – specifies the key of the settings.

  • section – specifies the section.

  • defaultValue – specifies the default value for the settings entry.

  • description – specifies a description for the settings entry.

  • options – specifies the options for the settings entry.

QgsSettingsEntryByReferenceQColorBase(QgsSettingsEntryByReferenceQColorBase)

Methods

checkValue

Check if the value is valid

convertFromVariant

Converts the variant value to the value type of the setting

convertToVariant

Converts the value to a variant

defaultValue

Returns settings default value.

formerValue

Returns the former value.

setValue

Set settings value.

setValuePrivate

Sets the settings value with an optional list of dynamic parts

setVariantValuePrivate

Sets the settings value with a variant value.

settingsType

rtype:

Qgis.SettingsType

value

Returns settings value.

valueWithDefaultOverride

Returns the settings value with a defaultValueOverride and with an optional dynamicKeyPart

checkValue(self, value: QColor | Qt.GlobalColor) bool

Check if the value is valid

Parameters:

value (Union[QColor) –

Return type:

bool

convertFromVariant(self, value: Any) QColor

Converts the variant value to the value type of the setting

Parameters:

value (Any) –

Return type:

QColor

convertToVariant(self, value: QColor | Qt.GlobalColor) Any

Converts the value to a variant

Parameters:

value (Union[QColor) –

Return type:

Any

defaultValue(self) QColor

Returns settings default value.

Return type:

QColor

formerValue(self, dynamicKeyPart: str = '') QColor

Returns the former value. Returns the current value (or default) if there is no former value.

formerValue(self, dynamicKeyPartList: Iterable[str]) -> QColor Returns the former value Returns the current value (or default) if there is no former value.

Parameters:

dynamicKeyPart (str = '') –

Return type:

QColor

setValue(self, value: QColor | Qt.GlobalColor, dynamicKeyPart: str = '') bool

Set settings value.

Parameters:
  • value (Union[QColor) – specifies the value to set.

  • dynamicKeyPart (str = '') – specifies the dynamic part of the settings key.

setValue(self, value: Union[QColor, Qt.GlobalColor], dynamicKeyPartList: Iterable[str]) -> bool Set settings value.

Parameters:
  • value – specifies the value to set.

  • dynamicKeyPartList – specifies the list of dynamic parts of the settings key.

Return type:

bool

setValuePrivate(self, value: QColor | Qt.GlobalColor, dynamicKeyPartList: Iterable[str]) bool

Sets the settings value with an optional list of dynamic parts

Parameters:
  • value (Union[QColor) –

  • dynamicKeyPartList (Iterable[str]) –

Return type:

bool

setVariantValuePrivate(self, value: Any, dynamicKeyPartList: Iterable[str] = []) bool

Sets the settings value with a variant value. This should be called from any implementation as it takes care of actually calling QSettings

New in version 3.26.

settingsType(self) Qgis.SettingsType
Return type:

Qgis.SettingsType

value(self, dynamicKeyPart: str = '') QColor

Returns settings value.

Parameters:

dynamicKeyPart (str = '') – specifies the dynamic part of the settings key.

value(self, dynamicKeyPartList: Iterable[str]) -> QColor Returns settings value.

Parameters:

dynamicKeyPartList – specifies the list of dynamic parts of the settings key.

value(self, dynamicKeyPart: str, useDefaultValueOverride: bool, defaultValueOverride: Union[QColor, Qt.GlobalColor]) -> QColor Returns the settings value for the dynamicKeyPart and with a defaultValueOverride

Deprecated since version QGIS: 3.26 use valueAsVariantWithDefaultOverride instead

value(self, dynamicKeyPartList: Iterable[str], useDefaultValueOverride: bool, defaultValueOverride: Union[QColor, Qt.GlobalColor]) -> QColor Returns the settings value for the dynamicKeyPartList and with a defaultValueOverride

Deprecated since version QGIS: 3.26 use valueAsVariantWithDefaultOverride instead

Return type:

QColor

valueWithDefaultOverride(self, defaultValueOverride: QColor | Qt.GlobalColor, dynamicKeyPart: str = '') QColor

Returns the settings value with a defaultValueOverride and with an optional dynamicKeyPart

valueWithDefaultOverride(self, defaultValueOverride: Union[QColor, Qt.GlobalColor], dynamicKeyPartList: Iterable[str]) -> QColor Returns the settings value with a defaultValueOverride for the dynamicKeyPartList

Parameters:
  • defaultValueOverride (Union[QColor) –

  • dynamicKeyPart (str = '') –

Return type:

QColor