22 QString QgsLoadLayerAlgorithm::name()
const 24 return QStringLiteral(
"loadlayer" );
27 QgsProcessingAlgorithm::Flags QgsLoadLayerAlgorithm::flags()
const 29 return FlagHideFromToolbox;
32 QString QgsLoadLayerAlgorithm::displayName()
const 34 return QObject::tr(
"Load layer into project" );
37 QStringList QgsLoadLayerAlgorithm::tags()
const 39 return QObject::tr(
"load,open,layer,raster,vector,project" ).split(
',' );
42 QString QgsLoadLayerAlgorithm::group()
const 44 return QObject::tr(
"Modeler tools" );
47 QString QgsLoadLayerAlgorithm::groupId()
const 49 return QStringLiteral(
"modelertools" );
52 QString QgsLoadLayerAlgorithm::shortHelpString()
const 54 return QObject::tr(
"This algorithm loads a layer to the current project." );
57 QgsLoadLayerAlgorithm *QgsLoadLayerAlgorithm::createInstance()
const 59 return new QgsLoadLayerAlgorithm();
62 void QgsLoadLayerAlgorithm::initAlgorithm(
const QVariantMap & )
71 QgsMapLayer *layer = parameterAsLayer( parameters, QStringLiteral(
"INPUT" ), context );
72 QString name = parameterAsString( parameters, QStringLiteral(
"NAME" ), context );
84 results.insert( QStringLiteral(
"OUTPUT" ), layer->
id() );
QgsProject * project() const
Returns the project in which the algorithm is being executed.
Base class for all map layer types.
Base class for providing feedback from a processing algorithm.
A map layer parameter for processing algorithms.
Custom exception class for processing related exceptions.
QString id() const
Returns the layer's unique ID, which is used to access this layer from QgsProject.
void setName(const QString &name)
Set the display name of the layer.
Details for layers to load into projects.
void addLayerToLoadOnCompletion(const QString &layer, const QgsProcessingContext::LayerDetails &details)
Adds a layer to load (by ID or datasource) into the canvas upon completion of the algorithm or model...
Contains information about the context in which a processing algorithm is executed.
A string parameter for processing algorithms.
A map layer output for processing algorithms, where layers may be either vector or raster...