23 QString QgsTruncateTableAlgorithm::name()
const
25 return QStringLiteral(
"truncatetable" );
28 QString QgsTruncateTableAlgorithm::displayName()
const
30 return QObject::tr(
"Truncate table" );
33 QStringList QgsTruncateTableAlgorithm::tags()
const
35 return QObject::tr(
"empty,delete,layer,clear,features" ).split(
',' );
38 QString QgsTruncateTableAlgorithm::group()
const
40 return QObject::tr(
"Vector general" );
43 QString QgsTruncateTableAlgorithm::groupId()
const
45 return QStringLiteral(
"vectorgeneral" );
48 QString QgsTruncateTableAlgorithm::shortHelpString()
const
50 return QObject::tr(
"This algorithm truncates a layer, by deleting all features from within the layer." )
51 + QStringLiteral(
"\n\n" )
52 + QObject::tr(
"Warning — this algorithm modifies the layer in place, and deleted features cannot be restored!" );
55 QgsProcessingAlgorithm::Flags QgsTruncateTableAlgorithm::flags()
const
60 QgsTruncateTableAlgorithm *QgsTruncateTableAlgorithm::createInstance()
const
62 return new QgsTruncateTableAlgorithm();
65 void QgsTruncateTableAlgorithm::initAlgorithm(
const QVariantMap & )
73 QgsVectorLayer *layer = parameterAsVectorLayer( parameters, QStringLiteral(
"INPUT" ), context );
84 outputs.insert( QStringLiteral(
"OUTPUT" ), layer->
id() );