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 );
Base class for all map layer types.
QString id() const
Returns the layer's unique ID, which is used to access this layer from QgsProject.
void triggerRepaint(bool deferredUpdate=false)
Will advise the map canvas (and any other interested party) that this layer requires to be repainted.
virtual QString loadNamedStyle(const QString &uri, bool &resultFlag, QgsMapLayer::StyleCategories categories=QgsMapLayer::AllStyleCategories)
Retrieve a named style for this layer if one exists (either as a .qml file on disk or as a record in ...
Contains information about the context in which a processing algorithm is executed.
Custom exception class for processing related exceptions.
Base class for providing feedback from a processing algorithm.
A map layer output for processing algorithms, where layers may be either vector or raster.
An input file or folder parameter for processing algorithms.
@ File
Parameter is a single file.
A map layer parameter for processing algorithms.