Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
also MapLayer
  • Loading branch information
ghtmtt authored and nyalldawson committed May 4, 2018
1 parent 94ad859 commit df4ddf2
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/core/processing/qgsprocessingparametertypeimpl.h
Expand Up @@ -85,6 +85,36 @@ class CORE_EXPORT QgsProcessingParameterTypeVectorLayer : public QgsProcessingPa
}
};

/**
* A generic map layer 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 QgsProcessingParameterTypeMapLayer : public QgsProcessingParameterType
{
virtual QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
{
return new QgsProcessingParameterMapLayer( name );
}

virtual QString description() const override
{
return QCoreApplication::translate( "Processing", "A generic map layer parameter, which accepts either vector or raster layers." );
}

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

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

/**
* A boolean parameter for processing algorithms.
*
Expand Down
1 change: 1 addition & 0 deletions src/core/processing/qgsprocessingregistry.cpp
Expand Up @@ -24,6 +24,7 @@ QgsProcessingRegistry::QgsProcessingRegistry( QObject *parent SIP_TRANSFERTHIS )
{
addParameterType( new QgsProcessingParameterTypeRasterLayer() );
addParameterType( new QgsProcessingParameterTypeVectorLayer() );
addParameterType( new QgsProcessingParameterTypeMapLayer() );
addParameterType( new QgsProcessingParameterTypeBoolean() );
addParameterType( new QgsProcessingParameterTypeExpression() );
addParameterType( new QgsProcessingParameterTypeCrs() );
Expand Down

0 comments on commit df4ddf2

Please sign in to comment.