22 QString QgsApplyLayerStyleAlgorithm::name()
const
24 return QStringLiteral(
"setlayerstyle" );
27 QString QgsApplyLayerStyleAlgorithm::displayName()
const
29 return QObject::tr(
"Set layer style" );
32 QStringList QgsApplyLayerStyleAlgorithm::tags()
const
34 return QObject::tr(
"change,layer,style,qml" ).split(
',' );
37 QString QgsApplyLayerStyleAlgorithm::group()
const
39 return QObject::tr(
"Cartography" );
42 QString QgsApplyLayerStyleAlgorithm::groupId()
const
44 return QStringLiteral(
"cartography" );
47 QString QgsApplyLayerStyleAlgorithm::shortHelpString()
const
49 return QObject::tr(
"Applies the style to a layer. The style must be defined as QML file." );
52 QgsApplyLayerStyleAlgorithm *QgsApplyLayerStyleAlgorithm::createInstance()
const
54 return new QgsApplyLayerStyleAlgorithm();
57 void QgsApplyLayerStyleAlgorithm::initAlgorithm(
const QVariantMap & )
66 QgsMapLayer *layer = parameterAsLayer( parameters, QStringLiteral(
"INPUT" ), context );
67 QString style = parameterAsFile( parameters, QStringLiteral(
"STYLE" ), context );
72 mLayerId = layer->
id();
87 Q_UNUSED( parameters );
91 results.insert( QStringLiteral(
"OUTPUT" ), mLayerId );