22QString QgsApplyLayerStyleAlgorithm::name()
const
24 return QStringLiteral(
"setlayerstyle" );
27QString QgsApplyLayerStyleAlgorithm::displayName()
const
29 return QObject::tr(
"Set layer style" );
32QStringList QgsApplyLayerStyleAlgorithm::tags()
const
34 return QObject::tr(
"change,layer,style,qml" ).split(
',' );
37QString QgsApplyLayerStyleAlgorithm::group()
const
39 return QObject::tr(
"Cartography" );
42QString QgsApplyLayerStyleAlgorithm::groupId()
const
44 return QStringLiteral(
"cartography" );
47QString QgsApplyLayerStyleAlgorithm::shortHelpString()
const
49 return QObject::tr(
"Applies the style to a layer. The style must be defined as QML file." );
52QgsApplyLayerStyleAlgorithm *QgsApplyLayerStyleAlgorithm::createInstance()
const
54 return new QgsApplyLayerStyleAlgorithm();
57void QgsApplyLayerStyleAlgorithm::initAlgorithm(
const QVariantMap & )
66 QgsMapLayer *layer = parameterAsLayer( parameters, QStringLiteral(
"INPUT" ), context );
67 const 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 &theURI, bool &resultFlag, bool loadFromLocalDb, QgsMapLayer::StyleCategories categories=QgsMapLayer::AllStyleCategories)
Loads a named style from file/local db/datasource db.
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.