Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Use proper Map Theme parameter type in rasterize algorithm
  • Loading branch information
nyalldawson committed Jan 5, 2020
1 parent 35e7fc7 commit 412ce7d
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions src/analysis/processing/qgsalgorithmrasterize.cpp
Expand Up @@ -90,17 +90,10 @@ void QgsRasterizeAlgorithm::initAlgorithm( const QVariantMap & )
QObject::tr( "Make background transparent" ),
false ) );

std::unique_ptr< QgsProcessingParameterString > mapThemeParam = qgis::make_unique< QgsProcessingParameterString >(
QStringLiteral( "MAP_THEME" ),
QObject::tr( "Map theme to render" ),
QVariant(), false, true );

QVariantMap metadataClass;
metadataClass.insert( QStringLiteral( "class" ), QStringLiteral( "processing.gui.wrappers_map_theme.MapThemeWrapper" ) );
QVariantMap metadata;
metadata.insert( QStringLiteral( "widget_wrapper" ), metadataClass );
mapThemeParam->setMetadata( metadata );
addParameter( mapThemeParam.release() );
addParameter( new QgsProcessingParameterMapTheme(
QStringLiteral( "MAP_THEME" ),
QObject::tr( "Map theme to render" ),
QVariant(), true ) );

QList<QgsMapLayer *> projectLayers { QgsProject::instance()->mapLayers().values() };
addParameter( new QgsProcessingParameterMultipleLayers(
Expand Down

0 comments on commit 412ce7d

Please sign in to comment.