QGIS API Documentation 4.3.0-Master (90cb4ecf9ef)
Loading...
Searching...
No Matches
qgsprocessingprojectmodelprovider.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsprocessingprojectmodelprovider.h
3 ------------------------
4 begin : August 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 QGSPROCESSINGPROJECTMODELPROVIDER_H
19#define QGSPROCESSINGPROJECTMODELPROVIDER_H
20
21#include "qgis_core.h"
23
24#include <QDomDocument>
25#include <QPointer>
26
27class QgsProcessingModelAlgorithm;
28
35{
36 Q_OBJECT
37
38 public:
42 QgsProcessingProjectModelProvider( QgsProject *project, QObject *parent SIP_TRANSFERTHIS = nullptr );
43
44 QString name() const override;
45 QString longName() const override;
46 QString id() const override;
47 QIcon icon() const override;
48 QString svgIconPath() const override;
49 bool supportsNonFileBasedOutput() const override;
50 bool load() override;
51
55 void clear();
56
60 void addModel( const QgsProcessingModelAlgorithm &model );
61
65 void removeModel( const QgsProcessingModelAlgorithm *model );
66
67 public slots:
68
72 void readProject( const QDomDocument &document );
73
77 void writeProject( QDomDocument &document );
78
79 protected:
80 void loadAlgorithms() override;
81
82 private slots:
83 void onProviderAdded( const QString &providerId );
84
85 private:
86 QPointer< QgsProject > mProject;
87 QMap< QString, QVariant > mModelDefinitions;
88 bool mIsLoading = false;
89};
90
91#endif // QGSPROCESSINGPROJECTMODELPROVIDER_H
void writeProject(QDomDocument &document)
Writes project model definitions into a project DOM document document.
void readProject(const QDomDocument &document)
Reads project model definitions from a project DOM document document.
void removeModel(const QgsProcessingModelAlgorithm *model)
Removes a model from the provider.
void addModel(const QgsProcessingModelAlgorithm &model)
Adds a model to the provider.
void clear()
Clears all models from the provider.
QgsProcessingProjectModelProvider(QgsProject *project, QObject *parent=nullptr)
Constructor for QgsProcessingProjectModelProvider, storing models in the specified project.
virtual QIcon icon() const
Returns an icon for the provider.
virtual QString name() const =0
Returns the provider name, which is used to describe the provider within the GUI.
QgsProcessingProvider(QObject *parent=nullptr)
Constructor for QgsProcessingProvider.
virtual QString svgIconPath() const
Returns a path to an SVG version of the provider's icon.
virtual QString id() const =0
Returns the unique provider id, used for identifying the provider.
virtual bool load()
Loads the provider.
virtual void loadAlgorithms()=0
Loads all algorithms belonging to this provider.
virtual QString longName() const
Returns the longer version of the provider name, which can include extra details such as version numb...
virtual bool supportsNonFileBasedOutput() const
Returns true if the provider supports non-file based outputs (such as memory layers or direct databas...
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition qgsproject.h:114
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:52