22QString QgsRenameLayerAlgorithm::name()
 const 
   24  return QStringLiteral( 
"renamelayer" );
 
   32QString QgsRenameLayerAlgorithm::displayName()
 const 
   34  return QObject::tr( 
"Rename layer" );
 
   37QStringList QgsRenameLayerAlgorithm::tags()
 const 
   39  return QObject::tr( 
"change,layer,name,title" ).split( 
',' );
 
   42QString QgsRenameLayerAlgorithm::group()
 const 
   44  return QObject::tr( 
"Modeler tools" );
 
   47QString QgsRenameLayerAlgorithm::groupId()
 const 
   49  return QStringLiteral( 
"modelertools" );
 
   52QString QgsRenameLayerAlgorithm::shortHelpString()
 const 
   54  return QObject::tr( 
"This algorithm renames a layer." );
 
   57QString QgsRenameLayerAlgorithm::shortDescription()
 const 
   59  return QObject::tr( 
"Renames a layer." );
 
   62QgsRenameLayerAlgorithm *QgsRenameLayerAlgorithm::createInstance()
 const 
   64  return new QgsRenameLayerAlgorithm();
 
   67void QgsRenameLayerAlgorithm::initAlgorithm( 
const QVariantMap & )
 
   76  QgsMapLayer *layer = parameterAsLayer( parameters, QStringLiteral( 
"INPUT" ), context );
 
   77  const QString name = parameterAsString( parameters, QStringLiteral( 
"NAME" ), context );
 
   85  const bool parameterWasLayerName = parameters.value( QStringLiteral( 
"INPUT" ) ).toString() == layer->
name();
 
   89  if ( parameterWasLayerName )
 
   90    results.insert( QStringLiteral( 
"OUTPUT" ), name );
 
   92    results.insert( QStringLiteral( 
"OUTPUT" ), parameters.value( QStringLiteral( 
"INPUT" ) ) );
 
QFlags< ProcessingAlgorithmFlag > ProcessingAlgorithmFlags
Flags indicating how and when an algorithm operates and should be exposed to users.
 
@ 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.
 
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.
 
A map layer parameter for processing algorithms.
 
A string parameter for processing algorithms.