Class: QgsProcessingDefaultStyleRegistry

A registry for default styles to apply to layers generated by Processing.

QgsProcessingDefaultStyleRegistry is not usually directly created, but rather accessed through QgsApplication.processingRegistry()->:py:func:defaultStyleRegistry() <qgis.core.QgsProcessingDefaultStyleRegistry.defaultStyleRegistry>.

Added in version 4.4.

List of all members, including inherited members

Class Hierarchy

Inheritance diagram of qgis.core.QgsProcessingDefaultStyleRegistry

Base classes

QObject

Constructor

__init__

Methods

defaultStyleForOutput

Returns the QML path to the default style to use for the specified output from an algorithm, or an empty string if no default style should be loaded for the output.

loadStyles

Loads all saved styles from the configuration file.

saveStyles

Saves registered styles to the configuration file.

setDefaultStyleForOutput

Sets the default style for an output from an algorithm.

class qgis.core.QgsProcessingDefaultStyleRegistry[source]

Bases: QObject

__init__(parent: QObject | None = None)

Constructor for QgsProcessingDefaultStyleRegistry.

QgsProcessingDefaultStyleRegistry is not usually directly created, but rather accessed through QgsApplication.processingRegistry()->:py:func:~QgsProcessingDefaultStyleRegistry.defaultStyleRegistry.

Parameters:

parent (QObject|None = None)

defaultStyleForOutput(self, algorithmId: str | None, outputName: str | None) → str[source]

Returns the QML path to the default style to use for the specified output from an algorithm, or an empty string if no default style should be loaded for the output.

Parameters:
  • algorithmId (str|None)

  • outputName (str|None)

Return type:

str

loadStyles(self)[source]

Loads all saved styles from the configuration file.

See also

saveStyles()

saveStyles(self)[source]

Saves registered styles to the configuration file.

See also

loadStyles()

setDefaultStyleForOutput(self, algorithmId: str | None, outputName: str | None, qmlPath: str | None)[source]

Sets the default style for an output from an algorithm.

Note

Calling this method does not automatically update the configuration file on disk. A separate call to saveStyles() must be made.

Parameters:
  • algorithmId (str|None)

  • outputName (str|None)

  • qmlPath (str|None)