Skip to content

Commit

Permalink
trying to add missing parameter in modeler
Browse files Browse the repository at this point in the history
  • Loading branch information
ghtmtt authored and nyalldawson committed May 4, 2018
1 parent 9b22d99 commit 94ad859
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/core/processing/qgsprocessingparametertypeimpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,36 @@ class CORE_EXPORT QgsProcessingParameterTypeBoolean : public QgsProcessingParame
}
};

/**
* An expression parameter for processing algorithms.
*
* \since QGIS 3.2
* \ingroup core
* \note No Python bindings available. Get your copy from QgsApplication.processingRegistry().parameterType()
*/
class CORE_EXPORT QgsProcessingParameterTypeExpression : public QgsProcessingParameterType
{
virtual QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
{
return new QgsProcessingParameterExpression( name );
}

virtual QString description() const override
{
return QCoreApplication::translate( "Processing", "An expression parameter, to add custom expressions based on layer fields." );
}

virtual QString name() const override
{
return QCoreApplication::translate( "Processing", "Expression" );
}

virtual QString id() const override
{
return QStringLiteral( "expression" );
}
};

/**
* A crs parameter for processing algorithms.
*
Expand Down
2 changes: 2 additions & 0 deletions src/core/processing/qgsprocessingregistry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ QgsProcessingRegistry::QgsProcessingRegistry( QObject *parent SIP_TRANSFERTHIS )
addParameterType( new QgsProcessingParameterTypeRasterLayer() );
addParameterType( new QgsProcessingParameterTypeVectorLayer() );
addParameterType( new QgsProcessingParameterTypeBoolean() );
addParameterType( new QgsProcessingParameterTypeExpression() );
addParameterType( new QgsProcessingParameterTypeCrs() );
addParameterType( new QgsProcessingParameterTypeRange() );
addParameterType( new QgsProcessingParameterTypePoint() );
Expand All @@ -42,6 +43,7 @@ QgsProcessingRegistry::QgsProcessingRegistry( QObject *parent SIP_TRANSFERTHIS )
addParameterType( new QgsProcessingParameterTypeFeatureSource() );
addParameterType( new QgsProcessingParameterTypeNumber() );
addParameterType( new QgsProcessingParameterTypeDistance() );
addParameterType( new QgsProcessingParameterTypeBand() );
}

QgsProcessingRegistry::~QgsProcessingRegistry()
Expand Down

0 comments on commit 94ad859

Please sign in to comment.