QGIS API Documentation  3.14.0-Pi (9f7028fd23)
qgsprocessingmodelerparameterwidget.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  qgsprocessingmodelerparameterwidget.cpp
3  ---------------------------------------
4  begin : August 2018
5  copyright : (C) 2018 by Nyall Dawson
6  email : nyall dot dawson at gmail dot com
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 
21 #include "qgsexpressionlineedit.h"
23 #include "models/qgsprocessingmodelalgorithm.h"
25 #include "qgsgui.h"
26 #include "qgsguiutils.h"
27 #include "qgsexpressioncontext.h"
28 #include "qgsapplication.h"
29 #include "qgsfilterlineedit.h"
30 #include <QHBoxLayout>
31 #include <QToolButton>
32 #include <QStackedWidget>
33 #include <QMenu>
34 #include <QLabel>
35 #include <QComboBox>
36 
38  const QString &childId,
39  const QgsProcessingParameterDefinition *parameter, QgsProcessingContext &context,
40  QWidget *parent )
41  : QWidget( parent )
42  , mModel( model )
43  , mChildId( childId )
44  , mParameterDefinition( parameter )
45  , mContext( context )
46 {
47  setFocusPolicy( Qt::StrongFocus );
48 
49  // icon size is a bit bigger than text, but minimum size of 24 so that we get pixel-aligned rendering on low-dpi screens
51 
52  QHBoxLayout *hLayout = new QHBoxLayout();
53 
54  mSourceButton = new QToolButton();
55  mSourceButton->setFocusPolicy( Qt::StrongFocus );
56 
57  // button width is 1.25 * icon size, height 1.1 * icon size. But we round to ensure even pixel sizes for equal margins
58  mSourceButton->setFixedSize( 2 * static_cast< int >( 1.25 * iconSize / 2.0 ), 2 * static_cast< int >( iconSize * 1.1 / 2.0 ) );
59  mSourceButton->setIconSize( QSize( iconSize, iconSize ) );
60  mSourceButton->setPopupMode( QToolButton::InstantPopup );
61 
62  mSourceMenu = new QMenu( this );
63  connect( mSourceMenu, &QMenu::aboutToShow, this, &QgsProcessingModelerParameterWidget::sourceMenuAboutToShow );
64  connect( mSourceMenu, &QMenu::triggered, this, &QgsProcessingModelerParameterWidget::sourceMenuActionTriggered );
65  mSourceButton->setMenu( mSourceMenu );
66 
67  hLayout->addWidget( mSourceButton );
68 
69  mStackedWidget = new QStackedWidget();
70 
71  mStaticWidgetWrapper.reset( QgsGui::processingGuiRegistry()->createParameterWidgetWrapper( mParameterDefinition, QgsProcessingGui::Modeler ) );
72  if ( mStaticWidgetWrapper )
73  {
74  QWidget *widget = mStaticWidgetWrapper->createWrappedWidget( context );
75  if ( widget )
76  {
77  mHasStaticWrapper = true;
78  mStackedWidget->addWidget( widget );
79  }
80  else
81  mStackedWidget->addWidget( new QWidget() );
82  }
83  else
84  {
85  mStackedWidget->addWidget( new QWidget() );
86  }
87 
88  mExpressionWidget = new QgsExpressionLineEdit();
89  mExpressionWidget->registerExpressionContextGenerator( this );
90  mStackedWidget->addWidget( mExpressionWidget );
91 
92  mModelInputCombo = new QComboBox();
93  QHBoxLayout *hLayout2 = new QHBoxLayout();
94  hLayout2->setMargin( 0 );
95  hLayout2->setContentsMargins( 0, 0, 0, 0 );
96  hLayout2->addWidget( new QLabel( tr( "Using model input" ) ) );
97  hLayout2->addWidget( mModelInputCombo, 1 );
98  QWidget *hWidget2 = new QWidget();
99  hWidget2->setLayout( hLayout2 );
100  mStackedWidget->addWidget( hWidget2 );
101 
102  mChildOutputCombo = new QComboBox();
103  QHBoxLayout *hLayout3 = new QHBoxLayout();
104  hLayout3->setMargin( 0 );
105  hLayout3->setContentsMargins( 0, 0, 0, 0 );
106  hLayout3->addWidget( new QLabel( tr( "Using algorithm output" ) ) );
107  hLayout3->addWidget( mChildOutputCombo, 1 );
108  QWidget *hWidget3 = new QWidget();
109  hWidget3->setLayout( hLayout3 );
110  mStackedWidget->addWidget( hWidget3 );
111 
112  if ( mParameterDefinition->isDestination() )
113  {
114  mModelOutputName = new QgsFilterLineEdit();
115  mModelOutputName->setPlaceholderText( tr( "[Enter name if this is a final result]" ) );
116  QHBoxLayout *hLayout4 = new QHBoxLayout();
117  hLayout4->setMargin( 0 );
118  hLayout4->setContentsMargins( 0, 0, 0, 0 );
119  hLayout4->addWidget( mModelOutputName );
120  QWidget *hWidget4 = new QWidget();
121  hWidget4->setLayout( hLayout4 );
122  mStackedWidget->addWidget( hWidget4 );
123  }
124 
125  hLayout->setMargin( 0 );
126  hLayout->setContentsMargins( 0, 0, 0, 0 );
127  hLayout->addWidget( mStackedWidget, 1 );
128 
129  setLayout( hLayout );
130  setSourceType( mParameterDefinition->isDestination() ? QgsProcessingModelChildParameterSource::ModelOutput : QgsProcessingModelChildParameterSource::StaticValue );
131 }
132 
134 
136 {
137  if ( mStaticWidgetWrapper )
138  mStaticWidgetWrapper->setWidgetContext( context );
139 }
140 
142 {
143  if ( mStaticWidgetWrapper )
144  mStaticWidgetWrapper->registerProcessingContextGenerator( generator );
145 }
146 
148 {
149  return mParameterDefinition;
150 }
151 
153 {
154  if ( mStaticWidgetWrapper )
155  return mStaticWidgetWrapper->createWrappedLabel();
156  else
157  return nullptr;
158 }
159 
160 void QgsProcessingModelerParameterWidget::setWidgetValue( const QgsProcessingModelChildParameterSource &value )
161 {
162  // we make a copy of all attributes and store locally, so that users can flick between
163  // sources without losing their current value
164  mStaticValue = value.staticValue();
165  mModelInputParameterName = value.parameterName();
166  mOutputChildId = value.outputChildId();
167  mOutputName = value.outputName();
168  mExpression = value.expression();
169 
170  updateUi();
171  setSourceType( value.source() );
172 }
173 
174 void QgsProcessingModelerParameterWidget::setWidgetValue( const QList<QgsProcessingModelChildParameterSource> &values )
175 {
176  if ( values.size() == 1 )
177  setWidgetValue( values.at( 0 ) );
178  else
179  {
180  QVariantList r;
181  for ( const QgsProcessingModelChildParameterSource &v : values )
182  r << QVariant::fromValue( v );
183  mStaticValue = r;
184  updateUi();
185  setSourceType( QgsProcessingModelChildParameterSource::StaticValue );
186  }
187 }
188 
190 {
191  if ( mModelOutputName )
192  mModelOutputName->setText( value );
193  setSourceType( QgsProcessingModelChildParameterSource::ModelOutput );
194 }
195 
197 {
198  return currentSourceType() == ModelOutput;
199 }
200 
202 {
203  return mModelOutputName ? mModelOutputName->text().trimmed() : QString();
204 }
205 
207 {
208  switch ( currentSourceType() )
209  {
210  case StaticValue:
211  {
212  const QVariant v = mStaticWidgetWrapper->parameterValue();
213 
214  if ( v.type() == QVariant::List )
215  {
216  const QVariantList vList = v.toList();
217  if ( std::all_of( vList.begin(), vList.end(), []( const QVariant & val )
218  {
219  return val.canConvert< QgsProcessingModelChildParameterSource >();
220  } ) )
221  {
222  return v;
223  }
224  }
225  return QVariant::fromValue( QgsProcessingModelChildParameterSource::fromStaticValue( v ) );
226  }
227 
228  case Expression:
229  return QVariant::fromValue( QgsProcessingModelChildParameterSource::fromExpression( mExpressionWidget->expression() ) );
230 
231  case ModelParameter:
232  return QVariant::fromValue( QgsProcessingModelChildParameterSource::fromModelParameter( mModelInputCombo->currentData().toString() ) );
233 
234  case ChildOutput:
235  {
236  const QStringList parts = mChildOutputCombo->currentData().toStringList();
237  return QVariant::fromValue( QgsProcessingModelChildParameterSource::fromChildOutput( parts.value( 0, QString() ), parts.value( 1, QString() ) ) );
238  }
239 
240  case ModelOutput:
241  return mModelOutputName ? ( mModelOutputName->text().trimmed().isEmpty() ? QVariant() : mModelOutputName->text() ) : QVariant();
242  }
243 
244  return QVariant::fromValue( QgsProcessingModelChildParameterSource() );
245 }
246 
248 {
249  if ( mStaticWidgetWrapper )
250  mStaticWidgetWrapper->setDialog( dialog );
251 }
252 
254 {
256  if ( mModel )
257  {
258  const QgsProcessingAlgorithm *alg = nullptr;
259  if ( mModel->childAlgorithms().contains( mChildId ) )
260  alg = mModel->childAlgorithm( mChildId ).algorithm();
261  QgsExpressionContextScope *algorithmScope = QgsExpressionContextUtils::processingAlgorithmScope( alg, QVariantMap(), mContext );
262  c << algorithmScope;
263  QgsExpressionContextScope *modelScope = QgsExpressionContextUtils::processingModelAlgorithmScope( mModel, QVariantMap(), mContext );
264  c << modelScope;
265  QgsExpressionContextScope *childScope = mModel->createExpressionContextScopeForChildAlgorithm( mChildId, mContext, QVariantMap(), QVariantMap() );
266  c << childScope;
267 
268  QStringList highlightedVariables = childScope->variableNames();
269  QStringList highlightedFunctions = childScope->functionNames();
270  highlightedVariables += algorithmScope->variableNames();
271  highlightedVariables += mModel->variables().keys();
272  highlightedFunctions += algorithmScope->functionNames();
273  c.setHighlightedVariables( highlightedVariables );
274  c.setHighlightedFunctions( highlightedFunctions );
275  }
276 
277  return c;
278 }
279 
280 void QgsProcessingModelerParameterWidget::sourceMenuAboutToShow()
281 {
282  mSourceMenu->clear();
283 
284  const SourceType currentSource = currentSourceType();
285 
286  if ( mParameterDefinition->isDestination() )
287  {
288  QAction *modelOutputAction = mSourceMenu->addAction( tr( "Model Output" ) );
289  modelOutputAction->setCheckable( currentSource == ModelOutput );
290  modelOutputAction->setChecked( currentSource == ModelOutput );
291  modelOutputAction->setData( QgsProcessingModelChildParameterSource::ModelOutput );
292  }
293 
294  if ( mHasStaticWrapper )
295  {
296  QAction *fixedValueAction = mSourceMenu->addAction( tr( "Value" ) );
297  fixedValueAction->setCheckable( currentSource == StaticValue );
298  fixedValueAction->setChecked( currentSource == StaticValue );
299  fixedValueAction->setData( QgsProcessingModelChildParameterSource::StaticValue );
300  }
301 
302  QAction *calculatedValueAction = mSourceMenu->addAction( tr( "Pre-calculated Value" ) );
303  calculatedValueAction->setCheckable( currentSource == Expression );
304  calculatedValueAction->setChecked( currentSource == Expression );
305  calculatedValueAction->setData( QgsProcessingModelChildParameterSource::Expression );
306 
307  QAction *inputValueAction = mSourceMenu->addAction( tr( "Model Input" ) );
308  inputValueAction->setCheckable( currentSource == ModelParameter );
309  inputValueAction->setChecked( currentSource == ModelParameter );
310  inputValueAction->setData( QgsProcessingModelChildParameterSource::ModelParameter );
311 
312  QAction *childOutputValueAction = mSourceMenu->addAction( tr( "Algorithm Output" ) );
313  childOutputValueAction->setCheckable( currentSource == ChildOutput );
314  childOutputValueAction->setChecked( currentSource == ChildOutput );
315  childOutputValueAction->setData( QgsProcessingModelChildParameterSource::ChildOutput );
316 
317  // TODO - expression text item?
318 }
319 
320 void QgsProcessingModelerParameterWidget::sourceMenuActionTriggered( QAction *action )
321 {
322  QgsProcessingModelChildParameterSource::Source sourceType = static_cast< QgsProcessingModelChildParameterSource::Source >( action->data().toInt() );
323  setSourceType( sourceType );
324 }
325 
326 QgsProcessingModelerParameterWidget::SourceType QgsProcessingModelerParameterWidget::currentSourceType() const
327 {
328  return static_cast< SourceType >( mStackedWidget->currentIndex() );
329 }
330 
331 void QgsProcessingModelerParameterWidget::setSourceType( QgsProcessingModelChildParameterSource::Source type )
332 {
333  switch ( type )
334  {
335  case QgsProcessingModelChildParameterSource::StaticValue:
336  mStackedWidget->setCurrentIndex( static_cast< int >( StaticValue ) );
337  mSourceButton->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "mIconFieldInteger.svg" ) ) );
338  mSourceButton->setToolTip( tr( "Value" ) );
339  break;
340 
341  case QgsProcessingModelChildParameterSource::Expression:
342  mSourceButton->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "mIconExpression.svg" ) ) );
343  mStackedWidget->setCurrentIndex( static_cast< int >( Expression ) );
344  mSourceButton->setToolTip( tr( "Pre-calculated Value" ) );
345  break;
346 
347  case QgsProcessingModelChildParameterSource::ModelParameter:
348  {
349  mSourceButton->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "processingModel.svg" ) ) );
350  mStackedWidget->setCurrentIndex( static_cast< int >( ModelParameter ) );
351  mSourceButton->setToolTip( tr( "Model Input" ) );
352  break;
353  }
354 
355  case QgsProcessingModelChildParameterSource::ChildOutput:
356  {
357  mSourceButton->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "processingAlgorithm.svg" ) ) );
358  mStackedWidget->setCurrentIndex( static_cast< int >( ChildOutput ) );
359  mSourceButton->setToolTip( tr( "Algorithm Output" ) );
360  break;
361  }
362 
363  case QgsProcessingModelChildParameterSource::ModelOutput:
364  {
365  mSourceButton->setIcon( QgsApplication::getThemeIcon( QStringLiteral( "mIconModelOutput.svg" ) ) );
366  mStackedWidget->setCurrentIndex( static_cast< int >( ModelOutput ) );
367  mSourceButton->setToolTip( tr( "Model Output" ) );
368  break;
369  }
370 
371  case QgsProcessingModelChildParameterSource::ExpressionText:
372  break;
373  }
374 }
375 
376 void QgsProcessingModelerParameterWidget::updateUi()
377 {
378  mStaticWidgetWrapper->setParameterValue( mStaticValue, mContext );
379 
380  mExpressionWidget->setExpression( mExpression );
381 
382  int currentIndex = mModelInputCombo->findData( mModelInputParameterName );
383  if ( currentIndex == -1 && mModelInputCombo->count() > 0 )
384  currentIndex = 0;
385  mModelInputCombo->setCurrentIndex( currentIndex );
386 
387  const QStringList parts = QStringList() << mOutputChildId << mOutputName;
388  currentIndex = mChildOutputCombo->findData( parts );
389  if ( currentIndex == -1 && mChildOutputCombo->count() > 0 )
390  currentIndex = 0;
391  mChildOutputCombo->setCurrentIndex( currentIndex );
392 }
393 
394 void QgsProcessingModelerParameterWidget::populateSources( const QStringList &compatibleParameterTypes, const QStringList &compatibleOutputTypes, const QList<int> &compatibleDataTypes )
395 {
396  const QList< QgsProcessingModelChildParameterSource > sources = mModel->availableSourcesForChild( mChildId,
397  compatibleParameterTypes, compatibleOutputTypes, compatibleDataTypes );
398 
399  for ( const QgsProcessingModelChildParameterSource &source : sources )
400  {
401  switch ( source.source() )
402  {
403  case QgsProcessingModelChildParameterSource::ModelParameter:
404  mModelInputCombo->addItem( mModel->parameterDefinition( source.parameterName() )->description(), source.parameterName() );
405  break;
406 
407  case QgsProcessingModelChildParameterSource::ChildOutput:
408  {
409  if ( !mModel->childAlgorithms().contains( source.outputChildId() ) )
410  continue;
411 
412  const QgsProcessingModelChildAlgorithm &alg = mModel->childAlgorithm( source.outputChildId() );
413  if ( !alg.algorithm() )
414  continue;
415  const QString outputDescription = alg.algorithm()->outputDefinition( source.outputName() )->description();
416  const QString childDescription = alg.description();
417 
418  mChildOutputCombo->addItem( tr( "“%1” from algorithm “%2”" ).arg( outputDescription, childDescription ), QStringList() << source.outputChildId() << source.outputName() );
419  break;
420  }
421 
422  case QgsProcessingModelChildParameterSource::StaticValue:
423  case QgsProcessingModelChildParameterSource::Expression:
424  case QgsProcessingModelChildParameterSource::ExpressionText:
425  case QgsProcessingModelChildParameterSource::ModelOutput:
426  break;
427  }
428 
429  }
430 }
431 
433 {
434  mExpressionWidget->setExpectedOutputFormat( text );
435 }
QgsProcessingModelerParameterWidget::setToModelOutput
void setToModelOutput(const QString &value)
Sets the widget to a model output, for destination parameters only.
Definition: qgsprocessingmodelerparameterwidget.cpp:189
QgsProcessingModelerParameterWidget::registerProcessingContextGenerator
void registerProcessingContextGenerator(QgsProcessingContextGenerator *generator)
Registers a Processing context generator class that will be used to retrieve a Processing context for...
Definition: qgsprocessingmodelerparameterwidget.cpp:141
QgsExpressionContext
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Definition: qgsexpressioncontext.h:369
QgsProcessingParameterWidgetContext
Definition: qgsprocessingwidgetwrapper.h:99
qgsexpressioncontextutils.h
QgsProcessingModelerParameterWidget::modelOutputName
QString modelOutputName() const
Returns the model output name, if isModelOutput() is true.
Definition: qgsprocessingmodelerparameterwidget.cpp:201
QgsApplication::getThemeIcon
static QIcon getThemeIcon(const QString &name)
Helper to get a theme icon.
Definition: qgsapplication.cpp:605
QgsProcessingModelerParameterWidget::createExpressionContext
QgsExpressionContext createExpressionContext() const override
This method needs to be reimplemented in all classes which implement this interface and return an exp...
Definition: qgsprocessingmodelerparameterwidget.cpp:253
qgsgui.h
qgsfilterlineedit.h
QgsFilterLineEdit
Definition: qgsfilterlineedit.h:39
QgsProcessingParameterDefinition
Definition: qgsprocessingparameters.h:330
QgsExpressionLineEdit::registerExpressionContextGenerator
void registerExpressionContextGenerator(const QgsExpressionContextGenerator *generator)
Register an expression context generator class that will be used to retrieve an expression context fo...
Definition: qgsexpressionlineedit.cpp:148
QgsProcessingModelerParameterWidget::setWidgetContext
void setWidgetContext(const QgsProcessingParameterWidgetContext &context)
Sets the context in which the modeler parameter widget is shown, e.g., the parent model algorithm and...
Definition: qgsprocessingmodelerparameterwidget.cpp:135
QgsProcessingModelerParameterWidget::isModelOutput
bool isModelOutput() const
Returns true if the widget is set to the model output mode.
Definition: qgsprocessingmodelerparameterwidget.cpp:196
QgsProcessingModelerParameterWidget::populateSources
void populateSources(const QStringList &compatibleParameterTypes, const QStringList &compatibleOutputTypes, const QList< int > &compatibleDataTypes)
Populates the widget with available sources for the parameter's value, e.g.
Definition: qgsprocessingmodelerparameterwidget.cpp:394
QgsGuiUtils::iconSize
QSize iconSize(bool dockableToolbar)
Returns the user-preferred size of a window's toolbar icons.
Definition: qgsguiutils.cpp:264
QgsExpressionContextScope::variableNames
QStringList variableNames() const
Returns a list of variable names contained within the scope.
Definition: qgsexpressioncontext.cpp:113
qgsapplication.h
QgsProcessingModelerParameterWidget::createLabel
QLabel * createLabel()
Creates a label for use identifying the associated parameter.
Definition: qgsprocessingmodelerparameterwidget.cpp:152
qgsexpressioncontext.h
qgsprocessingmodelerparameterwidget.h
QgsProcessingContext
Definition: qgsprocessingcontext.h:43
QgsProcessingModelerParameterWidget::~QgsProcessingModelerParameterWidget
~QgsProcessingModelerParameterWidget() override
QgsExpressionContextUtils::processingAlgorithmScope
static QgsExpressionContextScope * processingAlgorithmScope(const QgsProcessingAlgorithm *algorithm, const QVariantMap &parameters, QgsProcessingContext &context)
Creates a new scope which contains variables and functions relating to a processing algorithm,...
Definition: qgsexpressioncontextutils.cpp:760
QgsGui::processingGuiRegistry
static QgsProcessingGuiRegistry * processingGuiRegistry()
Returns the global processing gui registry, used for registering the GUI behavior of processing algor...
Definition: qgsgui.cpp:103
QgsExpressionContextUtils::processingModelAlgorithmScope
static QgsExpressionContextScope * processingModelAlgorithmScope(const QgsProcessingModelAlgorithm *model, const QVariantMap &parameters, QgsProcessingContext &context)
Creates a new scope which contains variables and functions relating to a processing model algorithm,...
Definition: qgsexpressioncontextutils.cpp:777
QgsProcessingGui::Modeler
@ Modeler
Modeler dialog.
Definition: qgsprocessinggui.h:42
QgsProcessingModelerParameterWidget::QgsProcessingModelerParameterWidget
QgsProcessingModelerParameterWidget(QgsProcessingModelAlgorithm *model, const QString &childId, const QgsProcessingParameterDefinition *parameter, QgsProcessingContext &context, QWidget *parent=nullptr)
Constructor for QgsProcessingModelerParameterWidget, for the specified parameter definition within th...
Definition: qgsprocessingmodelerparameterwidget.cpp:37
QgsExpressionLineEdit::setExpression
void setExpression(const QString &expression)
Sets the current expression to show in the widget.
Definition: qgsexpressionlineedit.cpp:153
QgsExpressionContextScope
Single scope for storing variables and functions for use within a QgsExpressionContext....
Definition: qgsexpressioncontext.h:111
QgsProcessingModelerParameterWidget::setDialog
void setDialog(QDialog *dialog)
Sets the parent dialog in which the widget is shown.
Definition: qgsprocessingmodelerparameterwidget.cpp:247
qgsprocessingparameters.h
QgsProcessingAlgorithm
Definition: qgsprocessingalgorithm.h:51
c
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 c
Definition: porting_processing.dox:1
qgsexpressionlineedit.h
QgsExpressionLineEdit::setExpectedOutputFormat
void setExpectedOutputFormat(const QString &expected)
Set the expected format string, which is shown in the expression builder dialog for the widget.
Definition: qgsexpressionlineedit.cpp:115
QgsProcessingContext::expressionContext
QgsExpressionContext & expressionContext()
Returns the expression context.
Definition: qgsprocessingcontext.h:119
QgsExpressionLineEdit
The QgsExpressionLineEdit widget includes a line edit for entering expressions together with a button...
Definition: qgsexpressionlineedit.h:48
QgsExpressionLineEdit::expression
QString expression() const
Returns the current expression shown in the widget.
Definition: qgsexpressionlineedit.cpp:132
QgsProcessingParameterDefinition::isDestination
virtual bool isDestination() const
Returns true if this parameter represents a file or layer destination, e.g.
Definition: qgsprocessingparameters.h:449
QgsProcessingModelerParameterWidget::parameterDefinition
const QgsProcessingParameterDefinition * parameterDefinition() const
Returns the parameter definition associated with this wrapper.
Definition: qgsprocessingmodelerparameterwidget.cpp:147
QgsProcessingModelerParameterWidget::setExpressionHelpText
void setExpressionHelpText(const QString &text)
Set the expected expression format text, which is shown in the expression builder dialog for the widg...
Definition: qgsprocessingmodelerparameterwidget.cpp:432
qgsguiutils.h
qgsprocessingguiregistry.h
QgsGuiUtils::scaleIconSize
int scaleIconSize(int standardSize)
Scales an icon size to compensate for display pixel density, making the icon size hi-dpi friendly,...
Definition: qgsguiutils.cpp:257
QgsProcessingModelerParameterWidget::setWidgetValue
virtual void setWidgetValue(const QgsProcessingModelChildParameterSource &value)
Sets the current value for the parameter.
Definition: qgsprocessingmodelerparameterwidget.cpp:160
QgsProcessingModelerParameterWidget::value
virtual QVariant value() const
Returns the current value of the parameter.
Definition: qgsprocessingmodelerparameterwidget.cpp:206
QgsProcessingContextGenerator
Definition: qgsprocessingwidgetwrapper.h:52