16#ifndef QGSPROCESSINGFIELDMAPWIDGETWRAPPER_H
17#define QGSPROCESSINGFIELDMAPWIDGETWRAPPER_H
20#include "ui_qgsprocessingfieldsmappingpanelbase.h"
33class GUI_EXPORT QgsProcessingFieldMapPanelWidget :
public QgsPanelWidget,
private Ui::QgsProcessingFieldMapPanelBase
38 QgsProcessingFieldMapPanelWidget( QWidget *parent =
nullptr );
42 QVariant value()
const;
43 void setValue(
const QVariant &value );
56 void loadFieldsFromLayer();
58 void loadLayerFields();
64 bool mSkipConfirmDialog =
false;
66 bool mBlockChangedSignal =
false;
67 friend class TestProcessingGui;
75 QgsProcessingFieldMapParameterDefinitionWidget( QgsProcessingContext &context,
const QgsProcessingParameterWidgetContext &widgetContext,
const QgsProcessingParameterDefinition *definition =
nullptr,
const QgsProcessingAlgorithm *
algorithm =
nullptr, QWidget *parent
SIP_TRANSFERTHIS =
nullptr );
76 QgsProcessingParameterDefinition *createParameter(
const QString &name,
const QString &description,
Qgis::ProcessingParameterFlags flags )
const override;
79 QComboBox *mParentLayerComboBox =
nullptr;
91 QString parameterType()
const override;
92 QgsAbstractProcessingParameterWidgetWrapper *createWidgetWrapper(
const QgsProcessingParameterDefinition *parameter,
Qgis::ProcessingMode type )
override SIP_FACTORY;
96 QgsProcessingAbstractParameterDefinitionWidget *createParameterDefinitionWidget(
97 QgsProcessingContext &context,
98 const QgsProcessingParameterWidgetContext &widgetContext,
99 const QgsProcessingParameterDefinition *definition =
nullptr,
100 const QgsProcessingAlgorithm *
algorithm =
nullptr
103 void postInitialize( const QList<QgsAbstractProcessingParameterWidgetWrapper *> &wrappers ) override;
104 int stretch() const override;
107 void setParentLayerWrapperValue( const QgsAbstractProcessingParameterWidgetWrapper *parentWrapper );
110 void setWidgetValue( const QVariant &value, QgsProcessingContext &context ) override;
111 QVariant widgetValue() const override;
113 QString modelerExpressionFormatString() const override;
114 const QgsVectorLayer *linkedVectorLayer() const override;
117 QgsProcessingFieldMapPanelWidget *mPanel =
nullptr;
118 std::unique_ptr<QgsVectorLayer> mParentLayer;
120 friend class TestProcessingGui;
ProcessingMode
Types of modes which Processing widgets can be created for.
@ Standard
Standard (single-run) algorithm mode.
QFlags< ProcessingParameterFlag > ProcessingParameterFlags
Flags which dictate the behavior of Processing parameters.
Abstract interface for generating an expression context.
Holds mapping information for mapping from one set of QgsFields to another.
Represents a vector layer which manages a vector based dataset.
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