Class: QgsSettingsEntryColor

A color settings entry.

Added in version 3.20.

List of all members, including inherited members

Class Hierarchy

Inheritance diagram of qgis.core.QgsSettingsEntryColor

Base classes

QgsSettingsEntryBaseTemplateQColorBase

Base abstract class for settings entries with typed get and set methods.

QgsSettingsEntryBase

Represents a settings entry and provides methods for reading and writing settings values.

Methods

allowAlpha

Returns True if transparency is allowed for the color

class qgis.core.QgsSettingsEntryColor[source]

Bases: QgsSettingsEntryBaseTemplateQColorBase

__init__(name: str | None, parent: QgsSettingsTreeNode | None, defaultValue: QColor | Qt.GlobalColor = QColor(), description: str | None = '', options: Qgis.SettingsOptions | Qgis.SettingsOption = Qgis.SettingsOptions(), allowAlpha: bool = True)

Constructor for QgsSettingsEntryColor.

Parameters:
  • name (Optional[str]) – specifies the name of the setting.

  • parent (Optional[QgsSettingsTreeNode]) – specifies the parent in the tree of settings.

  • defaultValue (Union[QColor, Qt.GlobalColor] = QColor()) – specifies the default value for the settings entry.

  • description (Optional[str] = '') – specifies a description for the settings entry.

  • options (Union[Qgis.SettingsOptions, Qgis.SettingsOption] = Qgis.SettingsOptions()) – specifies the options for the settings entry.

  • allowAlpha (bool = True) – specifies if the color can have transparency.

__init__(key: str | None, pluginName: str | None, defaultValue: QColor | Qt.GlobalColor = QColor(), description: str | None = '', options: Qgis.SettingsOptions | Qgis.SettingsOption = Qgis.SettingsOptions(), allowAlpha: bool = True)

Constructor for QgsSettingsEntryColor. This constructor is intended to be used from plugins.

Parameters:
  • key (Optional[str]) – specifies the key of the settings.

  • pluginName (Optional[str]) – is inserted in the key after the section.

  • defaultValue (Union[QColor, Qt.GlobalColor] = QColor()) – specifies the default value for the settings entry.

  • description (Optional[str] = '') – specifies a description for the settings entry.

  • options (Union[Qgis.SettingsOptions, Qgis.SettingsOption] = Qgis.SettingsOptions()) – specifies the options for the settings entry.

  • allowAlpha (bool = True)

__init__(a0: QgsSettingsEntryColor)
Parameters:

a0 (QgsSettingsEntryColor)

allowAlpha(self) bool[source]

Returns True if transparency is allowed for the color

Added in version 3.30.

Return type:

bool