QGIS API Documentation 3.41.0-Master (af5edcb665c)
Loading...
Searching...
No Matches
qgsprocessingalgorithmconfigurationwidget.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsprocessingalgorithmconfig.h
3 --------------------------
4 begin : April 2018
5 copyright : (C) 2018 by Matthias Kuhn
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
19#ifndef QGSPROCESSINGALGORITHMCONFIGURATIONWIDGET_H
20#define QGSPROCESSINGALGORITHMCONFIGURATIONWIDGET_H
21
22#include <QWidget>
23#include <QVariantMap>
24
25#include "qgis_gui.h"
26#include "qgis_sip.h"
28
31
32
41{
42 Q_OBJECT
43
44 public:
48 QgsProcessingAlgorithmConfigurationWidget( QWidget *parent = nullptr );
50
54 virtual QVariantMap configuration() const = 0;
55
59 virtual void setConfiguration( const QVariantMap &configuration ) = 0;
60
71 virtual void setWidgetContext( const QgsProcessingParameterWidgetContext &context );
72
81 const QgsProcessingParameterWidgetContext &widgetContext() const;
82
89 void setAlgorithm( const QgsProcessingAlgorithm *algorithm );
90
97 const QgsProcessingAlgorithm *algorithm() const { return mAlgorithm; }
98
105 void registerProcessingContextGenerator( QgsProcessingContextGenerator *generator );
106
108
109 private:
110 QgsProcessingContextGenerator *mContextGenerator = nullptr;
111 const QgsProcessingAlgorithm *mAlgorithm = nullptr;
113};
114
115
137
138
139#endif // QGSPROCESSINGALGORITHMCONFIGURATIONWIDGET_H
Abstract interface for generating an expression context.
virtual QgsExpressionContext createExpressionContext() const =0
This method needs to be reimplemented in all classes which implement this interface and return an exp...
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Interface base class for factories for algorithm configuration widgets.
virtual ~QgsProcessingAlgorithmConfigurationWidgetFactory()=default
virtual QgsProcessingAlgorithmConfigurationWidget * create(const QgsProcessingAlgorithm *algorithm) const =0
Create a new configuration widget for algorithm.
virtual bool canCreateFor(const QgsProcessingAlgorithm *algorithm) const =0
Check if this factory can create widgets for algorithm.
A configuration widget for processing algorithms allows providing additional configuration options di...
virtual QVariantMap configuration() const =0
Read the current configuration from this widget.
const QgsProcessingAlgorithm * algorithm() const
Returns the algorithm instance associated with this widget.
~QgsProcessingAlgorithmConfigurationWidget() override=default
virtual void setConfiguration(const QVariantMap &configuration)=0
Set the configuration which this widget should represent.
Abstract base class for processing algorithms.
An interface for objects which can create Processing contexts.
Contains settings which reflect the context in which a Processing parameter widget is shown,...
As part of the API refactoring and improvements which landed in the Processing API was substantially reworked from the x version This was done in order to allow much of the underlying Processing framework to be ported into allowing algorithms to be written in pure substantial changes are required in order to port existing x Processing algorithms for QGIS x The most significant changes are outlined not GeoAlgorithm For algorithms which operate on features one by consider subclassing the QgsProcessingFeatureBasedAlgorithm class This class allows much of the boilerplate code for looping over features from a vector layer to be bypassed and instead requires implementation of a processFeature method Ensure that your algorithm(or algorithm 's parent class) implements the new pure virtual createInstance(self) call
#define SIP_FACTORY
Definition qgis_sip.h:76