QGIS API Documentation 4.3.0-Master (dfb0041329c)
Loading...
Searching...
No Matches
qgsprocessingdefaultstyleregistry.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsprocessingdefaultstyleregistry.h
3 ------------------------
4 begin : Septeber 2026
5 copyright : (C) 2026 by Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef QGSPROCESSINGDEFAULTSTYLEREGISTRY_H
19#define QGSPROCESSINGDEFAULTSTYLEREGISTRY_H
20
21#include "qgis.h"
22#include "qgis_core.h"
23
24#include <QObject>
25
36class CORE_EXPORT QgsProcessingDefaultStyleRegistry : public QObject
37{
38 Q_OBJECT
39
40 public:
47 QgsProcessingDefaultStyleRegistry( QObject *parent = nullptr );
48
56 void setDefaultStyleForOutput( const QString &algorithmId, const QString &outputName, const QString &qmlPath );
57
64 QString defaultStyleForOutput( const QString &algorithmId, const QString &outputName ) const;
65
71 void loadStyles();
72
78 void saveStyles();
79
80 private:
81 static QString configFilePath();
82
83 // map of algorithm ID to map of output name to QML file path
84 QMap< QString, QMap< QString, QString > > mStyles;
85};
86
87
88#endif // QGSPROCESSINGDEFAULTSTYLEREGISTRY_H
void loadStyles()
Loads all saved styles from the configuration file.
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,...
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.
QgsProcessingDefaultStyleRegistry(QObject *parent=nullptr)
Constructor for QgsProcessingDefaultStyleRegistry.