23QString QgsTruncateTableAlgorithm::name()
const
25 return QStringLiteral(
"truncatetable" );
28QString QgsTruncateTableAlgorithm::displayName()
const
30 return QObject::tr(
"Truncate table" );
33QStringList QgsTruncateTableAlgorithm::tags()
const
35 return QObject::tr(
"empty,delete,layer,clear,features" ).split(
',' );
38QString QgsTruncateTableAlgorithm::group()
const
40 return QObject::tr(
"Vector general" );
43QString QgsTruncateTableAlgorithm::groupId()
const
45 return QStringLiteral(
"vectorgeneral" );
48QString 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!" );
60QgsTruncateTableAlgorithm *QgsTruncateTableAlgorithm::createInstance()
const
62 return new QgsTruncateTableAlgorithm();
65void QgsTruncateTableAlgorithm::initAlgorithm(
const QVariantMap & )
73 QgsVectorLayer *layer = parameterAsVectorLayer( parameters, QStringLiteral(
"INPUT" ), context );
84 outputs.insert( QStringLiteral(
"OUTPUT" ), layer->
id() );
@ Vector
Tables (i.e. vector layers with or without geometry). When used for a sink this indicates the sink ha...
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...
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.
Custom exception class for processing related exceptions.
Base class for providing feedback from a processing algorithm.
A vector layer output for processing algorithms.
A vector layer (with or without geometry) parameter for processing algorithms.
virtual bool truncate()
Removes all features from the layer.
Represents a vector layer which manages a vector based data sets.
QgsVectorDataProvider * dataProvider() FINAL
Returns the layer's data provider, it may be nullptr.