18 #ifndef QGSPROCESSINGPARAMETERS_H 19 #define QGSPROCESSINGPARAMETERS_H 21 #include "qgis_core.h" 57 , selectedFeaturesOnly( selectedFeaturesOnly )
65 , selectedFeaturesOnly( selectedFeaturesOnly )
85 return !( *
this == other );
89 operator QVariant()
const 91 return QVariant::fromValue( *
this );
118 , destinationProject( destinationProject )
128 , destinationProject( destinationProject )
162 QVariant toVariant()
const;
170 bool loadVariant(
const QVariantMap &map );
173 operator QVariant()
const 175 return QVariant::fromValue( *
this );
207 sipType = sipType_QgsProcessingParameterBoolean;
209 sipType = sipType_QgsProcessingParameterCrs;
211 sipType = sipType_QgsProcessingParameterMapLayer;
213 sipType = sipType_QgsProcessingParameterExtent;
215 sipType = sipType_QgsProcessingParameterPoint;
217 sipType = sipType_QgsProcessingParameterFile;
219 sipType = sipType_QgsProcessingParameterMatrix;
221 sipType = sipType_QgsProcessingParameterMultipleLayers;
223 sipType = sipType_QgsProcessingParameterNumber;
225 sipType = sipType_QgsProcessingParameterDistance;
227 sipType = sipType_QgsProcessingParameterRange;
229 sipType = sipType_QgsProcessingParameterRasterLayer;
231 sipType = sipType_QgsProcessingParameterEnum;
233 sipType = sipType_QgsProcessingParameterString;
235 sipType = sipType_QgsProcessingParameterExpression;
237 sipType = sipType_QgsProcessingParameterVectorLayer;
239 sipType = sipType_QgsProcessingParameterField;
241 sipType = sipType_QgsProcessingParameterFeatureSource;
243 sipType = sipType_QgsProcessingParameterFeatureSink;
245 sipType = sipType_QgsProcessingParameterVectorDestination;
247 sipType = sipType_QgsProcessingParameterRasterDestination;
249 sipType = sipType_QgsProcessingParameterFileDestination;
251 sipType = sipType_QgsProcessingParameterFolderDestination;
253 sipType = sipType_QgsProcessingParameterBand;
264 FlagAdvanced = 1 << 1,
266 FlagOptional = 1 << 3,
267 FlagIsModelOutput = 1 << 4,
269 Q_DECLARE_FLAGS( Flags,
Flag )
274 QgsProcessingParameterDefinition(
const QString &name,
const QString &description = QString(),
const QVariant &defaultValue = QVariant(),
275 bool optional =
false );
277 virtual ~QgsProcessingParameterDefinition() =
default;
282 virtual QgsProcessingParameterDefinition *clone()
const = 0
SIP_FACTORY;
287 virtual QString type()
const = 0;
301 QString
name()
const {
return mName; }
308 void setName(
const QString &name ) { mName = name; }
322 void setDescription(
const QString &description ) { mDescription = description; }
341 Flags
flags()
const {
return mFlags; }
356 virtual bool checkValueIsAcceptable(
const QVariant &input,
QgsProcessingContext *context =
nullptr )
const;
363 virtual QString valueAsPythonString(
const QVariant &value,
QgsProcessingContext &context )
const;
369 virtual QString asScriptCode()
const;
376 virtual QVariantMap toVariantMap()
const;
383 virtual bool fromVariantMap(
const QVariantMap &map );
405 void setMetadata(
const QVariantMap &metadata ) { mMetadata = metadata; }
431 virtual QString toolTip()
const;
514 bool mIsDynamic =
false;
527 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsProcessingParameterDefinition::Flags )
559 static bool isDynamic(
const QVariantMap ¶meters,
const QString &name );
564 static QString parameterAsString(
const QgsProcessingParameterDefinition *definition,
const QVariantMap ¶meters,
const QgsProcessingContext &context );
569 static QString parameterAsExpression(
const QgsProcessingParameterDefinition *definition,
const QVariantMap ¶meters,
const QgsProcessingContext &context );
574 static double parameterAsDouble(
const QgsProcessingParameterDefinition *definition,
const QVariantMap ¶meters,
const QgsProcessingContext &context );
579 static int parameterAsInt(
const QgsProcessingParameterDefinition *definition,
const QVariantMap ¶meters,
const QgsProcessingContext &context );
584 static int parameterAsEnum(
const QgsProcessingParameterDefinition *definition,
const QVariantMap ¶meters,
const QgsProcessingContext &context );
589 static QList<int> parameterAsEnums(
const QgsProcessingParameterDefinition *definition,
const QVariantMap ¶meters,
const QgsProcessingContext &context );
594 static bool parameterAsBool(
const QgsProcessingParameterDefinition *definition,
const QVariantMap ¶meters,
const QgsProcessingContext &context );
609 static QgsFeatureSink *parameterAsSink(
const QgsProcessingParameterDefinition *definition,
const QVariantMap ¶meters,
635 static QString parameterAsCompatibleSourceLayerPath(
const QgsProcessingParameterDefinition *definition,
const QVariantMap ¶meters,
645 static QgsMapLayer *parameterAsLayer(
const QgsProcessingParameterDefinition *definition,
const QVariantMap ¶meters,
QgsProcessingContext &context );
659 static QString parameterAsOutputLayer(
const QgsProcessingParameterDefinition *definition,
const QVariantMap ¶meters,
QgsProcessingContext &context );
664 static QString parameterAsFileOutput(
const QgsProcessingParameterDefinition *definition,
const QVariantMap ¶meters,
QgsProcessingContext &context );
703 static QgsGeometry parameterAsExtentGeometry(
const QgsProcessingParameterDefinition *definition,
const QVariantMap ¶meters,
QgsProcessingContext &context,
720 static QgsPointXY parameterAsPoint(
const QgsProcessingParameterDefinition *definition,
const QVariantMap ¶meters,
QgsProcessingContext &context,
733 static QString parameterAsFile(
const QgsProcessingParameterDefinition *definition,
const QVariantMap ¶meters,
QgsProcessingContext &context );
739 static QVariantList parameterAsMatrix(
const QgsProcessingParameterDefinition *definition,
const QVariantMap ¶meters,
QgsProcessingContext &context );
744 static QList< QgsMapLayer *> parameterAsLayerList(
const QgsProcessingParameterDefinition *definition,
const QVariantMap ¶meters,
QgsProcessingContext &context );
749 static QList<double> parameterAsRange(
const QgsProcessingParameterDefinition *definition,
const QVariantMap ¶meters,
QgsProcessingContext &context );
754 static QStringList parameterAsFields(
const QgsProcessingParameterDefinition *definition,
const QVariantMap ¶meters,
QgsProcessingContext &context );
761 static QgsProcessingParameterDefinition *parameterFromVariantMap(
const QVariantMap &map )
SIP_FACTORY;
766 static QString descriptionFromName(
const QString &name );
773 static QgsProcessingParameterDefinition *parameterFromScriptCode(
const QString &code )
SIP_FACTORY;
777 static bool parseScriptCodeParameterOptions(
const QString &code,
bool &isOptional, QString &name, QString &type, QString &definition );
796 bool optional =
false );
801 static QString
typeName() {
return QStringLiteral(
"boolean" ); }
803 QString
type()
const override {
return typeName(); }
826 QgsProcessingParameterCrs(
const QString &name,
const QString &description = QString(),
const QVariant &defaultValue = QVariant(),
827 bool optional =
false );
832 static QString
typeName() {
return QStringLiteral(
"crs" ); }
834 QString
type()
const override {
return typeName(); }
859 bool optional =
false );
864 static QString
typeName() {
return QStringLiteral(
"layer" ); }
866 QString
type()
const override {
return typeName(); }
891 bool optional =
false );
896 static QString
typeName() {
return QStringLiteral(
"extent" ); }
898 QString
type()
const override {
return typeName(); }
923 QgsProcessingParameterPoint(
const QString &name,
const QString &description = QString(),
const QVariant &defaultValue = QVariant(),
924 bool optional =
false );
929 static QString
typeName() {
return QStringLiteral(
"point" ); }
931 QString
type()
const override {
return typeName(); }
962 QgsProcessingParameterFile(
const QString &name,
const QString &description = QString(),
Behavior behavior = File,
const QString &extension = QString(),
const QVariant &defaultValue = QVariant(),
963 bool optional =
false );
968 static QString
typeName() {
return QStringLiteral(
"file" ); }
970 QString
type()
const override {
return typeName(); }
996 void setExtension(
const QString &extension ) { mExtension = extension; }
1026 bool hasFixedNumberRows =
false,
const QStringList &headers = QStringList(),
1027 const QVariant &defaultValue = QVariant(),
1028 bool optional =
false );
1033 static QString
typeName() {
return QStringLiteral(
"matrix" ); }
1035 QString
type()
const override {
return typeName(); }
1043 QStringList headers()
const;
1049 void setHeaders(
const QStringList &headers );
1057 int numberRows()
const;
1065 void setNumberRows(
int rows );
1072 bool hasFixedNumberRows()
const;
1079 void setHasFixedNumberRows(
bool hasFixedNumberRows );
1091 QStringList mHeaders;
1092 int mNumberRows = 3;
1093 bool mFixedNumberRows =
false;
1111 const QVariant &defaultValue = QVariant(),
1112 bool optional =
false );
1117 static QString
typeName() {
return QStringLiteral(
"multilayer" ); }
1119 QString
type()
const override {
return typeName(); }
1141 int minimumNumberInputs()
const;
1148 void setMinimumNumberInputs(
int minimum );
1161 int mMinimumNumberInputs = 0;
1186 Type type = Integer,
1187 const QVariant &defaultValue = QVariant(),
1188 bool optional =
false,
1189 double minValue = std::numeric_limits<double>::lowest() + 1,
1190 double maxValue = std::numeric_limits<double>::max()
1196 static QString
typeName() {
return QStringLiteral(
"number" ); }
1198 QString
type()
const override {
return typeName(); }
1201 QString
toolTip()
const override;
1207 double minimum()
const;
1213 void setMinimum(
double minimum );
1219 double maximum()
const;
1225 void setMaximum(
double maximum );
1231 Type dataType()
const;
1237 void setDataType(
Type type );
1249 double mMin = std::numeric_limits<double>::lowest() + 1;
1250 double mMax = std::numeric_limits<double>::max();
1251 Type mDataType = Integer;
1269 const QVariant &defaultValue = QVariant(),
1270 const QString &parentParameterName = QString(),
1271 bool optional =
false,
1272 double minValue = std::numeric_limits<double>::lowest() + 1,
1273 double maxValue = std::numeric_limits<double>::max() );
1278 static QString
typeName() {
return QStringLiteral(
"distance" ); }
1282 QString
type()
const override;
1289 QString parentParameterName()
const;
1295 void setParentParameterName(
const QString &parentParameterName );
1302 QString mParentParameterName;
1321 const QVariant &defaultValue = QVariant(),
1322 bool optional =
false );
1327 static QString
typeName() {
return QStringLiteral(
"range" ); }
1329 QString
type()
const override {
return typeName(); }
1372 bool optional =
false );
1377 static QString
typeName() {
return QStringLiteral(
"raster" ); }
1379 QString
type()
const override {
return typeName(); }
1403 QgsProcessingParameterEnum(
const QString &name,
const QString &description = QString(),
const QStringList &options = QStringList(),
1404 bool allowMultiple =
false,
1405 const QVariant &defaultValue = QVariant(),
1406 bool optional =
false );
1411 static QString
typeName() {
return QStringLiteral(
"enum" ); }
1413 QString
type()
const override {
return typeName(); }
1422 QStringList options()
const;
1428 void setOptions(
const QStringList &options );
1434 bool allowMultiple()
const;
1440 void setAllowMultiple(
bool allowMultiple );
1452 QStringList mOptions;
1453 bool mAllowMultiple =
false;
1471 bool multiLine =
false,
1472 bool optional =
false );
1477 static QString
typeName() {
return QStringLiteral(
"string" ); }
1479 QString
type()
const override {
return typeName(); }
1487 bool multiLine()
const;
1493 void setMultiLine(
bool multiLine );
1505 bool mMultiLine =
false;
1523 const QString &parentLayerParameterName = QString(),
1524 bool optional =
false );
1529 static QString
typeName() {
return QStringLiteral(
"expression" ); }
1531 QString
type()
const override {
return typeName(); }
1539 QString parentLayerParameterName()
const;
1545 void setParentLayerParameterName(
const QString &parentLayerParameterName );
1557 QString mParentLayerParameterName;
1581 QList< int > dataTypes()
const;
1587 void setDataTypes(
const QList< int > &types );
1610 const QString &description = QString(),
1611 const QList< int > &types = QList< int >(),
1612 const QVariant &defaultValue = QVariant(),
1613 bool optional =
false );
1618 static QString
typeName() {
return QStringLiteral(
"vector" ); }
1620 QString
type()
const override {
return typeName(); }
1656 QgsProcessingParameterField(
const QString &name,
const QString &description = QString(),
const QVariant &defaultValue = QVariant(),
1657 const QString &parentLayerParameterName = QString(),
1659 bool allowMultiple =
false,
1660 bool optional =
false );
1665 static QString
typeName() {
return QStringLiteral(
"field" ); }
1667 QString
type()
const override {
return typeName(); }
1677 QString parentLayerParameterName()
const;
1683 void setParentLayerParameterName(
const QString &parentLayerParameterName );
1701 bool allowMultiple()
const;
1707 void setAllowMultiple(
bool allowMultiple );
1719 QString mParentLayerParameterName;
1721 bool mAllowMultiple =
false;
1740 const QList< int > &types = QList< int >(),
1741 const QVariant &defaultValue = QVariant(),
bool optional =
false );
1746 static QString
typeName() {
return QStringLiteral(
"source" ); }
1748 QString
type()
const override {
return typeName(); }
1781 bool optional =
false,
bool createByDefault =
true );
1811 virtual QString defaultFileExtension()
const = 0;
1818 virtual QString generateTemporaryDestination()
const;
1825 bool createByDefault()
const;
1832 void setCreateByDefault(
bool createByDefault );
1857 bool mSupportsNonFileBasedOutputs =
true;
1858 bool mCreateByDefault =
true;
1860 friend class QgsProcessingModelAlgorithm;
1861 friend class TestQgsProcessing;
1884 bool optional =
false,
bool createByDefault =
true );
1889 static QString
typeName() {
return QStringLiteral(
"sink" ); }
1891 QString
type()
const override {
return typeName(); }
1903 virtual QStringList supportedOutputVectorLayerExtensions()
const;
1915 bool hasGeometry()
const;
1959 bool optional =
false,
bool createByDefault =
true );
1964 static QString
typeName() {
return QStringLiteral(
"vectorDestination" ); }
1966 QString
type()
const override {
return typeName(); }
1978 virtual QStringList supportedOutputVectorLayerExtensions()
const;
1990 bool hasGeometry()
const;
2030 const QVariant &defaultValue = QVariant(),
2031 bool optional =
false,
2032 bool createByDefault =
true );
2037 static QString
typeName() {
return QStringLiteral(
"rasterDestination" ); }
2039 QString
type()
const override {
return typeName(); }
2050 virtual QStringList supportedOutputRasterLayerExtensions()
const;
2076 const QString &fileFilter = QString(),
2077 const QVariant &defaultValue = QVariant(),
2078 bool optional =
false,
2079 bool createByDefault =
true );
2084 static QString
typeName() {
return QStringLiteral(
"fileDestination" ); }
2086 QString
type()
const override {
return typeName(); }
2096 QString fileFilter()
const;
2102 void setFileFilter(
const QString &filter );
2115 QString mFileFilter;
2134 const QVariant &defaultValue = QVariant(),
2135 bool optional =
false );
2140 static QString
typeName() {
return QStringLiteral(
"folderDestination" ); }
2142 QString
type()
const override {
return typeName(); }
2167 QgsProcessingParameterBand(
const QString &name,
const QString &description = QString(),
const QVariant &defaultValue = QVariant(),
2168 const QString &parentLayerParameterName = QString(),
2169 bool optional =
false );
2174 static QString
typeName() {
return QStringLiteral(
"band" ); }
2176 QString
type()
const override {
return typeName(); }
2186 QString parentLayerParameterName()
const;
2192 void setParentLayerParameterName(
const QString &parentLayerParameterName );
2204 QString mParentLayerParameterName;
2209 #endif // QGSPROCESSINGPARAMETERS_H QString type() const override
Unique parameter type name.
QgsProperty sink
Sink/layer definition.
A boolean parameter for processing algorithms.
QList< const QgsProcessingParameterDefinition *> QgsProcessingParameterDefinitions
List of processing parameters.
static QString typeName()
Returns the type name for the parameter class.
QgsPropertyDefinition dynamicPropertyDefinition() const
Returns the property definition for dynamic properties.
An input file or folder parameter for processing algorithms.
A parameter for processing algorithms which accepts multiple map layers.
virtual QString asScriptCode() const
Returns the parameter definition encoded in a string which can be used within a Python processing scr...
A rectangle specified with double values.
Base class for all map layer types.
QString type() const override
Unique parameter type name.
static QString typeName()
Returns the type name for the parameter class.
QVariantMap & metadata()
Returns the parameter's freeform metadata.
Base class for providing feedback from a processing algorithm.
virtual bool fromVariantMap(const QVariantMap &map)
Restores this parameter to a QVariantMap.
Encapsulates settings relating to a feature sink or output raster layer for a processing algorithm...
QgsProcessingFeatureSourceDefinition(const QString &source=QString(), bool selectedFeaturesOnly=false)
Constructor for QgsProcessingFeatureSourceDefinition, accepting a static string source.
QString type() const override
Unique parameter type name.
QString type() const override
Unique parameter type name.
void setIsDynamic(bool dynamic)
Sets whether the parameter is dynamic, and can support data-defined values (i.e.
QString type() const override
Unique parameter type name.
A vector layer or feature source field parameter for processing algorithms.
void setDynamicLayerParameterName(const QString &name)
Sets the name for the parameter for a layer linked to a dynamic parameter, or an empty string if this...
QString mDynamicLayerParameterName
Linked vector layer parameter name for dynamic properties.
static QString typeName()
Returns the type name for the parameter class.
QVariantMap metadata() const
Returns the parameter's freeform metadata.
static QString typeName()
Returns the type name for the parameter class.
This class provides qgis with the ability to render raster datasets onto the mapcanvas.
static QString typeName()
Returns the type name for the parameter class.
QString type() const override
Unique parameter type name.
QString type() const override
Unique parameter type name.
A map layer parameter for processing algorithms.
A class to represent a 2D point.
An expression parameter for processing algorithms.
static QString typeName()
Returns the type name for the parameter class.
QString type() const override
Unique parameter type name.
bool isDestination() const override
Returns true if this parameter represents a file or layer destination, e.g.
An interface for objects which accept features via addFeature(s) methods.
QgsProcessingProvider * originalProvider() const
Original (source) provider which this parameter has been derived from.
QString type() const override
Unique parameter type name.
static QString typeName()
Returns the type name for the parameter class.
static QString typeName()
Returns the type name for the parameter class.
QVariantMap mMetadata
Freeform metadata for parameter. Mostly used by widget wrappers to customize their appearance and beh...
QgsFeatureSource subclass which proxies methods to an underlying QgsFeatureSource, modifying results according to the settings in a QgsProcessingContext.
Container of fields for a vector layer.
A geometry is the spatial representation of a feature.
Abstract base class for processing providers.
virtual QVariantMap toVariantMap() const
Saves this parameter to a QVariantMap.
void setFlags(Flags flags)
Sets the flags associated with the parameter.
A raster band parameter for Processing algorithms.
QString type() const override
Unique parameter type name.
QVariantMap toVariantMap() const override
Saves this parameter to a QVariantMap.
virtual QString valueAsPythonString(const QVariant &value, QgsProcessingContext &context) const
Returns a string version of the parameter input value, which is suitable for use as an input paramete...
static QString typeName()
Returns the type name for the parameter class.
QString type() const override
Unique parameter type name.
static QString typeName()
Returns the type name for the parameter class.
QString type() const override
Unique parameter type name.
static QString typeName()
Returns the type name for the parameter class.
Base class for all parameter definitions which represent file or layer destinations, e.g.
Abstract base class for processing algorithms.
Q_DECLARE_METATYPE(QModelIndex)
A feature sink output for processing algorithms.
bool operator==(const QgsProcessingFeatureSourceDefinition &other)
bool selectedFeaturesOnly
True if only selected features in the source should be used by algorithms.
A raster layer destination parameter, for specifying the destination path for a raster layer created ...
static QString typeName()
Returns the type name for the parameter class.
A numeric range parameter for processing algorithms.
bool operator!=(const QgsProcessingFeatureSourceDefinition &other)
void setDynamicPropertyDefinition(const QgsPropertyDefinition &definition)
Sets the property definition for dynamic properties.
static QString typeName()
Returns the type name for the parameter class.
static QString typeName()
Returns the type name for the parameter class.
static QString typeName()
Returns the type name for the parameter class.
Can be inherited by parameters which require limits to their acceptable data types.
A raster layer parameter for processing algorithms.
Type
The WKB type describes the number of dimensions a geometry has.
void setDescription(const QString &description)
Sets the description for the parameter.
virtual QString toolTip() const
Returns a formatted tooltip for use with the parameter, which gives helpful information like paramete...
static QString typeName()
Returns the type name for the parameter class.
static QString typeName()
Returns the type name for the parameter class.
QgsProperty source
Source definition.
QString type() const override
Unique parameter type name.
An enum based parameter for processing algorithms, allowing for selection from predefined values...
Flags flags() const
Returns any flags associated with the parameter.
static QString typeName()
Returns the type name for the parameter class.
QVariant defaultValue() const
Returns the default value for the parameter.
QgsProcessingOutputLayerDefinition(const QgsProperty &sink, QgsProject *destinationProject=nullptr)
Constructor for QgsProcessingOutputLayerDefinition, accepting a QgsProperty sink/layer.
A collection of utilities for working with parameters when running a processing algorithm.
A double numeric parameter for distance values.
QString type() const override
Unique parameter type name.
Reads and writes project states.
void setDefaultValue(const QVariant &value)
Sets the default value for the parameter.
QString type() const override
Unique parameter type name.
A vector layer (with or without geometry) parameter for processing algorithms.
virtual QString defaultFileExtension() const =0
Returns the default file extension for destination file paths associated with this parameter...
A coordinate reference system parameter for processing algorithms.
A store for object properties.
virtual QStringList dependsOnOtherParameters() const
Returns a list of other parameter names on which this parameter is dependent (e.g.
A rectangular map extent parameter for processing algorithms.
QString type() const override
Unique parameter type name.
As part of the API refactoring and improvements which landed in the Processing API was substantially reworked from the x version This was done in order to allow much of the underlying Processing framework to be ported into allowing algorithms to be written in pure substantial changes are required in order to port existing x Processing algorithms for QGIS x The most significant changes are outlined not GeoAlgorithm For algorithms which operate on features one by consider subclassing the QgsProcessingFeatureBasedAlgorithm class This class allows much of the boilerplate code for looping over features from a vector layer to be bypassed and instead requires implementation of a processFeature method Ensure that your algorithm(or algorithm 's parent class) implements the new pure virtual createInstance(self) call
A numeric parameter for processing algorithms.
A generic file based destination parameter, for specifying the destination path for a file (non-map l...
void setExtension(const QString &extension)
Sets a file extension for the parameter.
QString dynamicLayerParameterName() const
Returns the name of the parameter for a layer linked to a dynamic parameter, or an empty string if th...
Definition for a property.
bool fromVariantMap(const QVariantMap &map) override
Restores this parameter to a QVariantMap.
QString name() const
Returns the name of the parameter.
QList< int > mDataTypes
List of acceptable data types for the parameter.
Encapsulates settings relating to a feature source input to a processing algorithm.
bool supportsNonFileBasedOutput() const
Returns true if the destination parameter supports non filed-based outputs, such as memory layers or ...
Behavior behavior() const
Returns the parameter behavior (e.g.
QString type() const override
Unique parameter type name.
virtual bool isDestination() const
Returns true if this parameter represents a file or layer destination, e.g.
QString extension() const
Returns any specified file extension for the parameter.
QString type() const override
Unique parameter type name.
Base class for the definition of processing outputs.
void setName(const QString &name)
Sets the name of the parameter.
A vector layer destination parameter, for specifying the destination path for a vector layer created ...
QString type() const override
Unique parameter type name.
bool isDynamic() const
Returns true if the parameter supports is dynamic, and can support data-defined values (i...
A point parameter for processing algorithms.
static QString typeName()
Returns the type name for the parameter class.
An input feature source (such as vector layers) parameter for processing algorithms.
void setMetadata(const QVariantMap &metadata)
Sets the parameter's freeform metadata.
A folder destination parameter, for specifying the destination path for a folder created by the algor...
QString destinationName
Name to use for sink if it's to be loaded into a destination project.
Flags mFlags
Parameter flags.
static QString typeName()
Returns the type name for the parameter class.
This class represents a coordinate reference system (CRS).
QgsProcessingOutputLayerDefinition(const QString &sink=QString(), QgsProject *destinationProject=nullptr)
Constructor for QgsProcessingOutputLayerDefinition, accepting a static sink/layer string...
Base class for the definition of processing parameters.
virtual bool checkValueIsAcceptable(const QVariant &input, QgsProcessingContext *context=nullptr) const
Checks whether the specified input value is acceptable for the parameter.
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
QVariantMap toVariantMap() const override
Saves this parameter to a QVariantMap.
QVariant mDefault
Default value for parameter.
SourceType
Data source types enum.
QgsPropertyDefinition mPropertyDefinition
Data defined property definition.
QgsProcessingParameterDefinition * clone() const override
Creates a clone of the parameter definition.
static QString typeName()
Returns the type name for the parameter class.
QString mName
Parameter name.
QgsProcessingFeatureSourceDefinition(const QgsProperty &source, bool selectedFeaturesOnly=false)
Constructor for QgsProcessingFeatureSourceDefinition, accepting a QgsProperty source.
static QString typeName()
Returns the type name for the parameter class.
Behavior
Parameter behavior.
virtual QString generateTemporaryDestination() const
Generates a temporary destination value for this parameter.
void setSupportsNonFileBasedOutput(bool supportsNonFileBasedOutput)
Sets whether the destination parameter supports non filed-based outputs, such as memory layers or dir...
static QString typeName()
Returns the type name for the parameter class.
DataType
Field data types.
A table (matrix) parameter for processing algorithms.
QString type() const override
Unique parameter type name.
QString mDescription
Parameter description.
bool fromVariantMap(const QVariantMap &map) override
Restores this parameter to a QVariantMap.
void setBehavior(Behavior behavior)
Sets the parameter behavior (e.g.
Represents a vector layer which manages a vector based data sets.
Contains information about the context in which a processing algorithm is executed.
A string parameter for processing algorithms.
QString type() const override
Unique parameter type name.
QString description() const
Returns the description for the parameter.
virtual QgsProcessingParameterDefinition * clone() const =0
Creates a clone of the parameter definition.
virtual QgsProcessingOutputDefinition * toOutputDefinition() const =0
Returns a new QgsProcessingOutputDefinition corresponding to the definition of the destination parame...
Any vector layer with geometry.
QString type() const override
Unique parameter type name.
QVariantMap createOptions
Map of optional sink/layer creation options, which are passed to the underlying provider when creatin...
QString type() const override
Unique parameter type name.
static QString typeName()
Returns the type name for the parameter class.