QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
qgsprocessingfieldmapwidgetwrapper.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  qgsprocessingfieldmapwidgetwrapper.cpp
3  ---------------------
4  Date : June 2020
5  Copyright : (C) 2020 by 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 
17 
18 #include <QBoxLayout>
19 #include <QLineEdit>
20 #include <QMessageBox>
21 #include <QPushButton>
22 #include <QStandardItemModel>
23 #include <QToolButton>
24 
25 #include "qgspanelwidget.h"
26 
27 #include "qgsprocessingcontext.h"
28 #include "qgsprocessingmodelalgorithm.h"
29 
31 
33 
34 //
35 // QgsProcessingFieldMapPanelWidget
36 //
37 
38 
39 QgsProcessingFieldMapPanelWidget::QgsProcessingFieldMapPanelWidget( QWidget *parent )
40  : QgsPanelWidget( parent )
41 {
42  setupUi( this );
43 
44  mModel = mFieldsView->model();
45  mFieldsView->setDestinationEditable( true );
46 
47  mLayerCombo->setAllowEmptyLayer( true );
48  mLayerCombo->setFilters( QgsMapLayerProxyModel::VectorLayer );
49 
50  connect( mResetButton, &QPushButton::clicked, this, &QgsProcessingFieldMapPanelWidget::loadFieldsFromLayer );
51  connect( mAddButton, &QPushButton::clicked, this, &QgsProcessingFieldMapPanelWidget::addField );
52  connect( mDeleteButton, &QPushButton::clicked, mFieldsView, &QgsFieldMappingWidget::removeSelectedFields );
53  connect( mUpButton, &QPushButton::clicked, mFieldsView, &QgsFieldMappingWidget::moveSelectedFieldsUp );
54  connect( mDownButton, &QPushButton::clicked, mFieldsView, &QgsFieldMappingWidget::moveSelectedFieldsDown );
55  connect( mLoadLayerFieldsButton, &QPushButton::clicked, this, &QgsProcessingFieldMapPanelWidget::loadLayerFields );
56 
57  connect( mFieldsView, &QgsFieldMappingWidget::changed, this, [ = ]
58  {
59  if ( !mBlockChangedSignal )
60  {
61  emit changed();
62  }
63  } );
64 }
65 
66 void QgsProcessingFieldMapPanelWidget::setLayer( QgsVectorLayer *layer )
67 {
68  if ( layer == mLayer )
69  return;
70 
71  mLayer = layer;
72  mFieldsView->setSourceLayer( mLayer );
73  if ( mModel->rowCount() == 0 )
74  {
75  loadFieldsFromLayer();
76  return;
77  }
78 
79  QMessageBox dlg( this );
80  dlg.setText( tr( "Do you want to reset the field mapping?" ) );
81  dlg.setStandardButtons(
82  QMessageBox::StandardButtons( QMessageBox::Yes |
83  QMessageBox::No ) );
84  dlg.setDefaultButton( QMessageBox::No );
85  if ( dlg.exec() == QMessageBox::Yes )
86  {
87  loadFieldsFromLayer();
88  }
89 }
90 
91 QgsVectorLayer *QgsProcessingFieldMapPanelWidget::layer()
92 {
93  return mLayer;
94 }
95 
96 QVariant QgsProcessingFieldMapPanelWidget::value() const
97 {
98  const QList<QgsFieldMappingModel::Field> mapping = mFieldsView->mapping();
99 
100  QVariantList results;
101  results.reserve( mapping.size() );
102  for ( const QgsFieldMappingModel::Field &field : mapping )
103  {
104  QVariantMap def;
105  def.insert( QStringLiteral( "name" ), field.field.name() );
106  def.insert( QStringLiteral( "type" ), static_cast< int >( field.field.type() ) );
107  def.insert( QStringLiteral( "length" ), field.field.length() );
108  def.insert( QStringLiteral( "precision" ), field.field.precision() );
109  def.insert( QStringLiteral( "expression" ), field.expression );
110  results.append( def );
111  }
112  return results;
113 }
114 
115 void QgsProcessingFieldMapPanelWidget::setValue( const QVariant &value )
116 {
117  if ( value.type() != QVariant::List )
118  return;
119 
120  QgsFields destinationFields;
121  QMap<QString, QString> expressions;
122 
123  const QgsFields layerFields = mLayer ? mLayer->fields() : QgsFields();
124  const QVariantList fields = value.toList();
125  for ( const QVariant &field : fields )
126  {
127  const QVariantMap map = field.toMap();
128  QgsField f( map.value( QStringLiteral( "name" ) ).toString(),
129  static_cast< QVariant::Type >( map.value( QStringLiteral( "type" ), QVariant::Invalid ).toInt() ),
130  QVariant::typeToName( static_cast< QVariant::Type >( map.value( QStringLiteral( "type" ), QVariant::Invalid ).toInt() ) ),
131  map.value( QStringLiteral( "length" ), 0 ).toInt(),
132  map.value( QStringLiteral( "precision" ), 0 ).toInt() );
133 
134  int layerFieldIdx = layerFields.indexFromName( f.name() );
135 
136  if ( mLayer && layerFieldIdx >= 0 && ! map.contains( QStringLiteral( "constraints" ) ) )
137  {
138  f.setConstraints( layerFields.at( layerFieldIdx ).constraints() );
139  }
140  else
141  {
142  const QgsFieldConstraints::Constraints constraints = static_cast<QgsFieldConstraints::Constraints>( map.value( QStringLiteral( "constraints" ), 0 ).toInt() );
143  QgsFieldConstraints fieldConstraints;
144 
145  if ( constraints & QgsFieldConstraints::ConstraintNotNull )
147  if ( constraints & QgsFieldConstraints::ConstraintUnique )
149  if ( constraints & QgsFieldConstraints::ConstraintExpression )
151 
152  f.setConstraints( fieldConstraints );
153  }
154 
155  if ( !map.value( QStringLiteral( "expression" ) ).toString().isEmpty() )
156  {
157  expressions.insert( f.name(), map.value( QStringLiteral( "expression" ) ).toString() );
158  }
159 
160  destinationFields.append( f );
161  }
162 
163  mBlockChangedSignal = true;
164  if ( destinationFields.size() > 0 )
165  mFieldsView->setDestinationFields( destinationFields, expressions );
166  mBlockChangedSignal = false;
167 
168  emit changed();
169 }
170 
171 void QgsProcessingFieldMapPanelWidget::registerExpressionContextGenerator( const QgsExpressionContextGenerator *generator )
172 {
173  mFieldsView->registerExpressionContextGenerator( generator );
174 }
175 
176 void QgsProcessingFieldMapPanelWidget::loadFieldsFromLayer()
177 {
178  if ( mLayer )
179  {
180  mFieldsView->setSourceFields( mLayer->fields() );
181  mFieldsView->setDestinationFields( mLayer->fields() );
182  }
183 }
184 
185 void QgsProcessingFieldMapPanelWidget::addField()
186 {
187  const int rowCount = mModel->rowCount();
188  mModel->appendField( QgsField( QStringLiteral( "new_field" ) ) );
189  QModelIndex index = mModel->index( rowCount, 0 );
190  mFieldsView->selectionModel()->select(
191  index,
192  QItemSelectionModel::SelectionFlags(
193  QItemSelectionModel::Clear |
194  QItemSelectionModel::Select |
195  QItemSelectionModel::Current |
196  QItemSelectionModel::Rows ) );
197  mFieldsView->scrollTo( index );
198 }
199 
200 void QgsProcessingFieldMapPanelWidget::loadLayerFields()
201 {
202  if ( QgsVectorLayer *vl = qobject_cast< QgsVectorLayer * >( mLayerCombo->currentLayer() ) )
203  {
204  mFieldsView->setSourceFields( vl->fields() );
205  mFieldsView->setDestinationFields( vl->fields() );
206  }
207 }
208 
209 //
210 // QgsProcessingFieldMapParameterDefinitionWidget
211 //
212 
213 QgsProcessingFieldMapParameterDefinitionWidget::QgsProcessingFieldMapParameterDefinitionWidget( QgsProcessingContext &context, const QgsProcessingParameterWidgetContext &widgetContext, const QgsProcessingParameterDefinition *definition, const QgsProcessingAlgorithm *algorithm, QWidget *parent )
214  : QgsProcessingAbstractParameterDefinitionWidget( context, widgetContext, definition, algorithm, parent )
215 {
216  QVBoxLayout *vlayout = new QVBoxLayout();
217  vlayout->setContentsMargins( 0, 0, 0, 0 );
218 
219  vlayout->addWidget( new QLabel( tr( "Parent layer" ) ) );
220 
221  mParentLayerComboBox = new QComboBox();
222  mParentLayerComboBox->addItem( tr( "None" ), QVariant() );
223 
224  QString initialParent;
225  if ( const QgsProcessingParameterFieldMapping *mapParam = dynamic_cast<const QgsProcessingParameterFieldMapping *>( definition ) )
226  initialParent = mapParam->parentLayerParameterName();
227 
228  if ( auto *lModel = widgetContext.model() )
229  {
230  // populate combo box with other model input choices
231  const QMap<QString, QgsProcessingModelParameter> components = lModel->parameterComponents();
232  for ( auto it = components.constBegin(); it != components.constEnd(); ++it )
233  {
234  if ( const QgsProcessingParameterFeatureSource *definition = dynamic_cast< const QgsProcessingParameterFeatureSource * >( lModel->parameterDefinition( it.value().parameterName() ) ) )
235  {
236  mParentLayerComboBox-> addItem( definition->description(), definition->name() );
237  if ( !initialParent.isEmpty() && initialParent == definition->name() )
238  {
239  mParentLayerComboBox->setCurrentIndex( mParentLayerComboBox->count() - 1 );
240  }
241  }
242  else if ( const QgsProcessingParameterVectorLayer *definition = dynamic_cast< const QgsProcessingParameterVectorLayer * >( lModel->parameterDefinition( it.value().parameterName() ) ) )
243  {
244  mParentLayerComboBox-> addItem( definition->description(), definition->name() );
245  if ( !initialParent.isEmpty() && initialParent == definition->name() )
246  {
247  mParentLayerComboBox->setCurrentIndex( mParentLayerComboBox->count() - 1 );
248  }
249  }
250  }
251  }
252 
253  if ( mParentLayerComboBox->count() == 1 && !initialParent.isEmpty() )
254  {
255  // if no parent candidates found, we just add the existing one as a placeholder
256  mParentLayerComboBox->addItem( initialParent, initialParent );
257  mParentLayerComboBox->setCurrentIndex( mParentLayerComboBox->count() - 1 );
258  }
259 
260  vlayout->addWidget( mParentLayerComboBox );
261  setLayout( vlayout );
262 }
263 
264 QgsProcessingParameterDefinition *QgsProcessingFieldMapParameterDefinitionWidget::createParameter( const QString &name, const QString &description, QgsProcessingParameterDefinition::Flags flags ) const
265 {
266  auto param = qgis::make_unique< QgsProcessingParameterFieldMapping >( name, description, mParentLayerComboBox->currentData().toString() );
267  param->setFlags( flags );
268  return param.release();
269 }
270 
271 //
272 // QgsProcessingFieldMapWidgetWrapper
273 //
274 
275 QgsProcessingFieldMapWidgetWrapper::QgsProcessingFieldMapWidgetWrapper( const QgsProcessingParameterDefinition *parameter, QgsProcessingGui::WidgetType type, QWidget *parent )
276  : QgsAbstractProcessingParameterWidgetWrapper( parameter, type, parent )
277 {
278 }
279 
280 QString QgsProcessingFieldMapWidgetWrapper::parameterType() const
281 {
283 }
284 
285 QgsAbstractProcessingParameterWidgetWrapper *QgsProcessingFieldMapWidgetWrapper::createWidgetWrapper( const QgsProcessingParameterDefinition *parameter, QgsProcessingGui::WidgetType type )
286 {
287  return new QgsProcessingFieldMapWidgetWrapper( parameter, type );
288 }
289 
290 QWidget *QgsProcessingFieldMapWidgetWrapper::createWidget()
291 {
292  mPanel = new QgsProcessingFieldMapPanelWidget( nullptr );
293  mPanel->setToolTip( parameterDefinition()->toolTip() );
294  mPanel->registerExpressionContextGenerator( this );
295 
296  connect( mPanel, &QgsProcessingFieldMapPanelWidget::changed, this, [ = ]
297  {
298  emit widgetValueHasChanged( this );
299  } );
300 
301  return mPanel;
302 }
303 
304 QgsProcessingAbstractParameterDefinitionWidget *QgsProcessingFieldMapWidgetWrapper::createParameterDefinitionWidget( QgsProcessingContext &context, const QgsProcessingParameterWidgetContext &widgetContext, const QgsProcessingParameterDefinition *definition, const QgsProcessingAlgorithm *algorithm )
305 {
306  return new QgsProcessingFieldMapParameterDefinitionWidget( context, widgetContext, definition, algorithm );
307 }
308 
309 void QgsProcessingFieldMapWidgetWrapper::postInitialize( const QList<QgsAbstractProcessingParameterWidgetWrapper *> &wrappers )
310 {
312  switch ( type() )
313  {
316  {
317  for ( const QgsAbstractProcessingParameterWidgetWrapper *wrapper : wrappers )
318  {
319  if ( wrapper->parameterDefinition()->name() == static_cast< const QgsProcessingParameterFieldMapping * >( parameterDefinition() )->parentLayerParameterName() )
320  {
321  setParentLayerWrapperValue( wrapper );
323  {
324  setParentLayerWrapperValue( wrapper );
325  } );
326  break;
327  }
328  }
329  break;
330  }
331 
333  break;
334  }
335 }
336 
337 int QgsProcessingFieldMapWidgetWrapper::stretch() const
338 {
339  return 1;
340 }
341 
342 void QgsProcessingFieldMapWidgetWrapper::setParentLayerWrapperValue( const QgsAbstractProcessingParameterWidgetWrapper *parentWrapper )
343 {
344  // evaluate value to layer
345  QgsProcessingContext *context = nullptr;
346  std::unique_ptr< QgsProcessingContext > tmpContext;
347  if ( mProcessingContextGenerator )
348  context = mProcessingContextGenerator->processingContext();
349 
350  if ( !context )
351  {
352  tmpContext = qgis::make_unique< QgsProcessingContext >();
353  context = tmpContext.get();
354  }
355 
356  QgsVectorLayer *layer = QgsProcessingParameters::parameterAsVectorLayer( parentWrapper->parameterDefinition(), parentWrapper->parameterValue(), *context );
357  if ( !layer )
358  {
359  if ( mPanel )
360  mPanel->setLayer( nullptr );
361  return;
362  }
363 
364  // need to grab ownership of layer if required - otherwise layer may be deleted when context
365  // goes out of scope
366  std::unique_ptr< QgsMapLayer > ownedLayer( context->takeResultLayer( layer->id() ) );
367  if ( ownedLayer && ownedLayer->type() == QgsMapLayerType::VectorLayer )
368  {
369  mParentLayer.reset( qobject_cast< QgsVectorLayer * >( ownedLayer.release() ) );
370  layer = mParentLayer.get();
371  }
372  else
373  {
374  // don't need ownership of this layer - it wasn't owned by context (so e.g. is owned by the project)
375  }
376 
377  if ( mPanel )
378  mPanel->setLayer( layer );
379 }
380 
381 void QgsProcessingFieldMapWidgetWrapper::setWidgetValue( const QVariant &value, QgsProcessingContext & )
382 {
383  if ( mPanel )
384  mPanel->setValue( value );
385 }
386 
387 QVariant QgsProcessingFieldMapWidgetWrapper::widgetValue() const
388 {
389  return mPanel ? mPanel->value() : QVariant();
390 }
391 
392 QStringList QgsProcessingFieldMapWidgetWrapper::compatibleParameterTypes() const
393 {
394  return QStringList()
396 }
397 
398 QStringList QgsProcessingFieldMapWidgetWrapper::compatibleOutputTypes() const
399 {
400  return QStringList();
401 }
402 
403 QString QgsProcessingFieldMapWidgetWrapper::modelerExpressionFormatString() const
404 {
405  return tr( "an array of map items, each containing a 'name', 'type' and 'expression' values (and optional 'length' and 'precision' values)." );
406 }
407 
408 const QgsVectorLayer *QgsProcessingFieldMapWidgetWrapper::linkedVectorLayer() const
409 {
410  if ( mPanel && mPanel->layer() )
411  return mPanel->layer();
412 
414 }
415 
417 
QgsProcessingParameterWidgetContext
Contains settings which reflect the context in which a Processing parameter widget is shown,...
Definition: qgsprocessingwidgetwrapper.h:100
qgsprocessingparameterfieldmap.h
QgsFieldConstraints::setConstraint
void setConstraint(Constraint constraint, ConstraintOrigin origin=ConstraintOriginLayer)
Sets a constraint on the field.
Definition: qgsfieldconstraints.cpp:48
QgsMapLayerType::VectorLayer
@ VectorLayer
QgsField::length
int length
Definition: qgsfield.h:55
QgsProcessingParameterDefinition::description
QString description() const
Returns the description for the parameter.
Definition: qgsprocessingparameters.h:474
algorithm
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
QgsFieldConstraints
Stores information about constraints which may be present on a field.
Definition: qgsfieldconstraints.h:33
QgsProcessingContext::takeResultLayer
QgsMapLayer * takeResultLayer(const QString &id)
Takes the result map layer with matching id from the context and transfers ownership of it back to th...
Definition: qgsprocessingcontext.cpp:126
QgsFields
Container of fields for a vector layer.
Definition: qgsfields.h:45
QgsProcessingParameterDefinition
Base class for the definition of processing parameters.
Definition: qgsprocessingparameters.h:331
QgsProcessingParameterFeatureSource
An input feature source (such as vector layers) parameter for processing algorithms.
Definition: qgsprocessingparameters.h:2734
field
const QgsField & field
Definition: qgsfield.h:456
QgsFields::append
bool append(const QgsField &field, FieldOrigin origin=OriginProvider, int originIndex=-1)
Appends a field. The field must have unique name, otherwise it is rejected (returns false)
Definition: qgsfields.cpp:59
QgsAbstractProcessingParameterWidgetWrapper
A widget wrapper for Processing parameter value widgets.
Definition: qgsprocessingwidgetwrapper.h:267
QgsField::name
QString name
Definition: qgsfield.h:59
QgsFieldConstraints::ConstraintNotNull
@ ConstraintNotNull
Field may not be null.
Definition: qgsfieldconstraints.h:45
QgsProcessingGui::Standard
@ Standard
Standard algorithm dialog.
Definition: qgsprocessinggui.h:40
QgsMapLayerProxyModel::VectorLayer
@ VectorLayer
Definition: qgsmaplayerproxymodel.h:50
QgsField::precision
int precision
Definition: qgsfield.h:56
QgsPanelWidget
Base class for any widget that can be shown as a inline panel.
Definition: qgspanelwidget.h:30
QgsProcessingParameters::parameterAsVectorLayer
static QgsVectorLayer * parameterAsVectorLayer(const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context)
Evaluates the parameter with matching definition to a vector layer.
Definition: qgsprocessingparameters.cpp:946
QgsProcessingContext
Contains information about the context in which a processing algorithm is executed.
Definition: qgsprocessingcontext.h:44
QgsProcessingParameterDefinition::name
QString name() const
Returns the name of the parameter.
Definition: qgsprocessingparameters.h:460
QgsProcessingGui::Batch
@ Batch
Batch processing dialog.
Definition: qgsprocessinggui.h:41
QgsFields::size
int size() const
Returns number of items.
Definition: qgsfields.cpp:138
QgsFieldConstraints::ConstraintUnique
@ ConstraintUnique
Field must have a unique value.
Definition: qgsfieldconstraints.h:46
QgsMapLayer::id
QString id() const
Returns the layer's unique ID, which is used to access this layer from QgsProject.
Definition: qgsmaplayer.cpp:148
QgsProcessingGui::Modeler
@ Modeler
Modeler dialog.
Definition: qgsprocessinggui.h:42
QgsAbstractProcessingParameterWidgetWrapper::widgetValueHasChanged
void widgetValueHasChanged(QgsAbstractProcessingParameterWidgetWrapper *wrapper)
Emitted whenever the parameter value (as defined by the wrapped widget) is changed.
QgsAbstractProcessingParameterWidgetWrapper::linkedVectorLayer
virtual const QgsVectorLayer * linkedVectorLayer() const
Returns the optional vector layer associated with this widget wrapper, or nullptr if no vector layer ...
Definition: qgsprocessingwidgetwrapper.cpp:245
QgsProcessingParameterVectorLayer
A vector layer (with or without geometry) parameter for processing algorithms.
Definition: qgsprocessingparameters.h:2504
QgsProcessingAbstractParameterDefinitionWidget
Abstract base class for widgets which allow users to specify the properties of a Processing parameter...
Definition: qgsprocessingparameterdefinitionwidget.h:44
QgsProcessingParameterFieldMapping
A parameter for "field mapping" configurations, which consist of a definition of desired output field...
Definition: qgsprocessingparameterfieldmap.h:32
QgsFieldMappingModel::Field
The Field struct holds information about a mapped field.
Definition: qgsfieldmappingmodel.h:65
QgsProcessingGui::WidgetType
WidgetType
Types of dialogs which Processing widgets can be created for.
Definition: qgsprocessinggui.h:39
QgsProcessingAlgorithm
Abstract base class for processing algorithms.
Definition: qgsprocessingalgorithm.h:52
QgsProcessingParameterFieldMapping::typeName
static QString typeName()
Returns the type name for the parameter class.
Definition: qgsprocessingparameterfieldmap.h:47
QgsVectorLayer
Represents a vector layer which manages a vector based data sets.
Definition: qgsvectorlayer.h:387
QgsFieldMappingWidget::removeSelectedFields
bool removeSelectedFields()
Removes the currently selected field from the model.
Definition: qgsfieldmappingwidget.cpp:132
QgsAbstractProcessingParameterWidgetWrapper::parameterValue
QVariant parameterValue() const
Returns the current value of the parameter.
Definition: qgsprocessingwidgetwrapper.cpp:201
QgsFieldConstraints::ConstraintExpression
@ ConstraintExpression
Field has an expression constraint set. See constraintExpression().
Definition: qgsfieldconstraints.h:47
QgsField::constraints
QgsFieldConstraints constraints
Definition: qgsfield.h:62
qgsprocessingcontext.h
QgsProcessingParameterWidgetContext::model
QgsProcessingModelAlgorithm * model() const
Returns the model which the parameter widget is associated with.
Definition: qgsprocessingwidgetwrapper.cpp:94
QgsFieldMappingWidget::moveSelectedFieldsDown
bool moveSelectedFieldsDown()
Moves down the currently selected field.
Definition: qgsfieldmappingwidget.cpp:165
qgsprocessingfieldmapwidgetwrapper.h
qgspanelwidget.h
QgsFields::at
QgsField at(int i) const
Gets field at particular index (must be in range 0..N-1)
Definition: qgsfields.cpp:163
QgsFieldMappingWidget::changed
void changed()
Emitted when the fields defined in the widget are changed.
QgsAbstractProcessingParameterWidgetWrapper::parameterDefinition
const QgsProcessingParameterDefinition * parameterDefinition() const
Returns the parameter definition associated with this wrapper.
Definition: qgsprocessingwidgetwrapper.cpp:181
QgsFieldMappingWidget::moveSelectedFieldsUp
bool moveSelectedFieldsUp()
Moves up currently selected field.
Definition: qgsfieldmappingwidget.cpp:149
QgsExpressionContextGenerator
Abstract interface for generating an expression context.
Definition: qgsexpressioncontextgenerator.h:37
QgsFields::indexFromName
int indexFromName(const QString &fieldName) const
Gets the field index from the field name.
Definition: qgsfields.cpp:202
QgsField::type
QVariant::Type type
Definition: qgsfield.h:57
QgsAbstractProcessingParameterWidgetWrapper::postInitialize
virtual void postInitialize(const QList< QgsAbstractProcessingParameterWidgetWrapper * > &wrappers)
Called after all wrappers have been created within a particular dialog or context,...
Definition: qgsprocessingwidgetwrapper.cpp:252
QgsField
Encapsulate a field in an attribute table or data source.
Definition: qgsfield.h:50