QGIS API Documentation 4.3.0-Master (16649ce5cc6)
Loading...
Searching...
No Matches
QgsProcessingDefaultStyleRegistry Class Reference

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

#include <qgsprocessingdefaultstyleregistry.h>

Inheritance diagram for QgsProcessingDefaultStyleRegistry:

Public Member Functions

 QgsProcessingDefaultStyleRegistry (QObject *parent=nullptr)
 Constructor for QgsProcessingDefaultStyleRegistry.
QString defaultStyleForOutput (const QString &algorithmId, const QString &outputName) const
 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.
void loadStyles ()
 Loads all saved styles from the configuration file.
void saveStyles ()
 Saves registered styles to the configuration file.
void setDefaultStyleForOutput (const QString &algorithmId, const QString &outputName, const QString &qmlPath)
 Sets the default style for an output from an algorithm.

Detailed Description

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

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

Since
QGIS 4.4

Definition at line 36 of file qgsprocessingdefaultstyleregistry.h.

Constructor & Destructor Documentation

◆ QgsProcessingDefaultStyleRegistry()

QgsProcessingDefaultStyleRegistry::QgsProcessingDefaultStyleRegistry ( QObject * parent = nullptr)

Constructor for QgsProcessingDefaultStyleRegistry.

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

Definition at line 30 of file qgsprocessingdefaultstyleregistry.cpp.

Member Function Documentation

◆ defaultStyleForOutput()

QString QgsProcessingDefaultStyleRegistry::defaultStyleForOutput ( const QString & algorithmId,
const QString & outputName ) const

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.

See also
setDefaultStyleForOutput()

Definition at line 53 of file qgsprocessingdefaultstyleregistry.cpp.

◆ loadStyles()

void QgsProcessingDefaultStyleRegistry::loadStyles ( )

Loads all saved styles from the configuration file.

See also
saveStyles()

Definition at line 64 of file qgsprocessingdefaultstyleregistry.cpp.

◆ saveStyles()

void QgsProcessingDefaultStyleRegistry::saveStyles ( )

Saves registered styles to the configuration file.

See also
loadStyles()

Definition at line 96 of file qgsprocessingdefaultstyleregistry.cpp.

◆ setDefaultStyleForOutput()

void QgsProcessingDefaultStyleRegistry::setDefaultStyleForOutput ( const QString & algorithmId,
const QString & outputName,
const QString & qmlPath )

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.
See also
defaultStyleForOutput()

Definition at line 34 of file qgsprocessingdefaultstyleregistry.cpp.


The documentation for this class was generated from the following files: