Class: QgsCodeEditorColorSchemeRegistry

A registry of color schemes for use in QgsCodeEditor widgets.

QgsCodeEditorColorSchemeRegistry is not usually directly created, but rather accessed through QgsGui.codeEditorColorSchemeRegistry().

Added in version 3.16.

List of all members, including inherited members

Methods

addColorScheme

Adds a color scheme to the registry.

removeColorScheme

Removes the color scheme with matching id from the registry.

scheme

Returns the color scheme with matching id.

schemes

for all registered color schemes.

class qgis.gui.QgsCodeEditorColorSchemeRegistry[source]

Bases: object

__init__()

Constructor for a color scheme registry.

__init__(a0: QgsCodeEditorColorSchemeRegistry)
Parameters:

a0 (QgsCodeEditorColorSchemeRegistry)

addColorScheme(self, scheme: QgsCodeEditorColorScheme) bool[source]

Adds a color scheme to the registry.

Returns True if the scheme was successfully added.

Parameters:

scheme (QgsCodeEditorColorScheme)

Return type:

bool

removeColorScheme(self, id: str | None) bool[source]

Removes the color scheme with matching id from the registry.

Returns True if scheme was found and removed.

Parameters:

id (Optional[str])

Return type:

bool

scheme(self, id: str | None) QgsCodeEditorColorScheme[source]

Returns the color scheme with matching id.

If the specified scheme id does not exist then the default scheme will be returned instead.

Parameters:

id (Optional[str])

Return type:

QgsCodeEditorColorScheme

schemes(self) list[str][source]

for all registered color schemes.