24QString QgsTruncateTableAlgorithm::name()
const
26 return QStringLiteral(
"truncatetable" );
29QString QgsTruncateTableAlgorithm::displayName()
const
31 return QObject::tr(
"Truncate table" );
34QStringList QgsTruncateTableAlgorithm::tags()
const
36 return QObject::tr(
"empty,delete,layer,clear,features" ).split(
',' );
39QString QgsTruncateTableAlgorithm::group()
const
41 return QObject::tr(
"Vector general" );
44QString QgsTruncateTableAlgorithm::groupId()
const
46 return QStringLiteral(
"vectorgeneral" );
49QString QgsTruncateTableAlgorithm::shortHelpString()
const
51 return QObject::tr(
"This algorithm truncates a layer, by deleting all features from within the layer." )
52 + QStringLiteral(
"\n\n" )
53 + QObject::tr(
"Warning — this algorithm modifies the layer in place, and deleted features cannot be restored!" );
56QString QgsTruncateTableAlgorithm::shortDescription()
const
58 return QObject::tr(
"Truncates a layer, by deleting all features from within the layer." );
66QgsTruncateTableAlgorithm *QgsTruncateTableAlgorithm::createInstance()
const
68 return new QgsTruncateTableAlgorithm();
71void QgsTruncateTableAlgorithm::initAlgorithm(
const QVariantMap & )
79 QgsVectorLayer *layer = parameterAsVectorLayer( parameters, QStringLiteral(
"INPUT" ), context );
90 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 dataset.
QgsVectorDataProvider * dataProvider() final
Returns the layer's data provider, it may be nullptr.