24using namespace Qt::StringLiterals;
28QString QgsTransferAnnotationsFromMainAlgorithm::name()
const
30 return u
"transferannotationsfrommain"_s;
33QString QgsTransferAnnotationsFromMainAlgorithm::displayName()
const
35 return QObject::tr(
"Transfer annotations from main layer" );
38QStringList QgsTransferAnnotationsFromMainAlgorithm::tags()
const
40 return QObject::tr(
"annotations,drawing,cosmetic,objects" ).split(
',' );
43QString QgsTransferAnnotationsFromMainAlgorithm::group()
const
45 return QObject::tr(
"Cartography" );
48QString QgsTransferAnnotationsFromMainAlgorithm::groupId()
const
50 return u
"cartography"_s;
58QString QgsTransferAnnotationsFromMainAlgorithm::shortHelpString()
const
60 return QObject::tr(
"This algorithm transfers all annotations from the main annotation layer in a project to a new annotation layer." );
63QString QgsTransferAnnotationsFromMainAlgorithm::shortDescription()
const
65 return QObject::tr(
"Transfers all annotations from the main annotation layer in a project to a new annotation layer." );
68QgsTransferAnnotationsFromMainAlgorithm *QgsTransferAnnotationsFromMainAlgorithm::createInstance()
const
70 return new QgsTransferAnnotationsFromMainAlgorithm();
73void QgsTransferAnnotationsFromMainAlgorithm::initAlgorithm(
const QVariantMap & )
89 std::unique_ptr<QgsAnnotationLayer> newLayer(
main->clone() );
90 newLayer->setName( parameterAsString( parameters, u
"LAYER_NAME"_s, context ) );
94 outputs.insert( u
"OUTPUT"_s, newLayer->id() );
QFlags< ProcessingAlgorithmFlag > ProcessingAlgorithmFlags
Flags indicating how and when an algorithm operates and should be exposed to users.
@ NoThreading
Algorithm is not thread safe and cannot be run in a background thread, e.g. for algorithms which mani...
@ RequiresProject
The algorithm requires that a valid QgsProject is available from the processing context in order to e...
Represents a map layer containing a set of georeferenced annotations, e.g.
virtual Qgis::ProcessingAlgorithmFlags flags() const
Returns the flags indicating how and when the algorithm operates and should be exposed to users.
Contains information about the context in which a processing algorithm is executed.
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 string parameter for processing algorithms.
QgsAnnotationLayer * mainAnnotationLayer()
Returns the main annotation layer associated with the project.
QgsMapLayer * addMapLayer(QgsMapLayer *mapLayer, bool addToLegend=true, bool takeOwnership=true)
Add a layer to the map of loaded layers.
int main(int argc, char *argv[])