QGIS API Documentation  3.20.0-Odense (decaadbb31)
qgsprocessingparameterswidget.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsprocessingparameterswidget.h
3  ----------------------------------
4  Date : March 2020
5  Copyright : (C) 2020 Nyall Dawson
6  Email : nyall dot dawson at gmail dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #ifndef QGSPROCESSINGPARAMETERSWIDGET_H
17 #define QGSPROCESSINGPARAMETERSWIDGET_H
18 
19 #include "qgis.h"
20 #include "qgis_gui.h"
21 #include "ui_qgsprocessingparameterswidgetbase.h"
22 #include <QWidget>
24 
27 
29 
36 class GUI_EXPORT QgsProcessingParametersWidget : public QgsPanelWidget, public QgsProcessingParametersGenerator, private Ui::QgsProcessingParametersWidgetBase
37 {
38  Q_OBJECT
39 
40  public:
41 
45  QgsProcessingParametersWidget( const QgsProcessingAlgorithm *algorithm, QWidget *parent SIP_TRANSFERTHIS = nullptr );
46 
47  const QgsProcessingAlgorithm *algorithm() const;
48 
49  protected:
50 
51  virtual void initWidgets();
52 
53  void addParameterWidget( const QgsProcessingParameterDefinition *parameter, QWidget *widget SIP_TRANSFER, int stretch = 0 );
54  void addParameterLabel( const QgsProcessingParameterDefinition *parameter, QWidget *label SIP_TRANSFER );
55 
56  void addOutputLabel( QWidget *label SIP_TRANSFER );
57  void addOutputWidget( QWidget *widget SIP_TRANSFER, int stretch = 0 );
58 
59  void addExtraWidget( QWidget *widget SIP_TRANSFER );
60 
61  private:
62 
63  const QgsProcessingAlgorithm *mAlgorithm = nullptr;
64 
65  friend class TestProcessingGui;
66 };
67 
69 
70 #endif // QGSPROCESSINGPARAMETERSWIDGET_H
Base class for any widget that can be shown as a inline panel.
Abstract base class for processing algorithms.
Base class for the definition of processing parameters.
An interface for objects which can create sets of parameter values for processing algorithms.
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_TRANSFERTHIS
Definition: qgis_sip.h:53
#define SIP_TRANSFER
Definition: qgis_sip.h:36