QGIS API Documentation 3.41.0-Master (af5edcb665c)
Loading...
Searching...
No Matches
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
36class GUI_EXPORT QgsProcessingParametersWidget : public QgsPanelWidget, public QgsProcessingParametersGenerator, private Ui::QgsProcessingParametersWidgetBase
37{
38 Q_OBJECT
39
40 public:
44 QgsProcessingParametersWidget( const QgsProcessingAlgorithm *algorithm, QWidget *parent SIP_TRANSFERTHIS = nullptr );
45
46 const QgsProcessingAlgorithm *algorithm() const;
47
48 protected:
49 virtual void initWidgets();
50
51 void addParameterWidget( const QgsProcessingParameterDefinition *parameter, QWidget *widget SIP_TRANSFER, int stretch = 0 );
52 void addParameterLabel( const QgsProcessingParameterDefinition *parameter, QWidget *label SIP_TRANSFER );
53
54 void addOutputLabel( QWidget *label SIP_TRANSFER );
55 void addOutputWidget( QWidget *widget SIP_TRANSFER, int stretch = 0 );
56
57 void addExtraWidget( QWidget *widget SIP_TRANSFER );
58
59 private:
60 const QgsProcessingAlgorithm *mAlgorithm = nullptr;
61
62 friend class TestProcessingGui;
63};
64
66
67#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