22using namespace Qt::StringLiterals;
26QString QgsLoadLayerAlgorithm::name()
const
28 return u
"loadlayer"_s;
36QString QgsLoadLayerAlgorithm::displayName()
const
38 return QObject::tr(
"Load layer into project" );
41QStringList QgsLoadLayerAlgorithm::tags()
const
43 return QObject::tr(
"load,open,layer,raster,vector,project" ).split(
',' );
46QString QgsLoadLayerAlgorithm::group()
const
48 return QObject::tr(
"Modeler tools" );
51QString QgsLoadLayerAlgorithm::groupId()
const
53 return u
"modelertools"_s;
56QString QgsLoadLayerAlgorithm::shortHelpString()
const
58 return QObject::tr(
"This algorithm loads a layer to the current project." );
61QString QgsLoadLayerAlgorithm::shortDescription()
const
63 return QObject::tr(
"Loads a layer to the current project." );
66QgsLoadLayerAlgorithm *QgsLoadLayerAlgorithm::createInstance()
const
68 return new QgsLoadLayerAlgorithm();
71void QgsLoadLayerAlgorithm::initAlgorithm(
const QVariantMap & )
80 QgsMapLayer *layer = parameterAsLayer( parameters, u
"INPUT"_s, context );
81 const QString name = parameterAsString( parameters, u
"NAME"_s, context );
91 details.forceName =
true;
95 results.insert( u
"OUTPUT"_s, layer->
id() );
QFlags< ProcessingAlgorithmFlag > ProcessingAlgorithmFlags
Flags indicating how and when an algorithm operates and should be exposed to users.
@ NotAvailableInStandaloneTool
Algorithm should not be available from the standalone "qgis_process" tool. Used to flag algorithms wh...
@ HideFromToolbox
Algorithm should be hidden from the toolbox.
Base class for all map layer types.
void setName(const QString &name)
Set the display name of the layer.
Details for layers to load into projects.
Contains information about the context in which a processing algorithm is executed.
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.
QgsProject * project() const
Returns the project in which the algorithm is being 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.
A map layer parameter for processing algorithms.
A string parameter for processing algorithms.