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 );
@ File
Parameter is a single file.
Base class for all map layer types.
virtual QString loadNamedStyle(const QString &theURI, bool &resultFlag, bool loadFromLocalDb, QgsMapLayer::StyleCategories categories=QgsMapLayer::AllStyleCategories, Qgis::LoadStyleFlags flags=Qgis::LoadStyleFlags())
Loads a named style from file/local db/datasource db.
void triggerRepaint(bool deferredUpdate=false)
Will advise the map canvas (and any other interested party) that this layer requires to be repainted.
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.
A map layer parameter for processing algorithms.