22using namespace Qt::StringLiterals;
54 if ( !input.isValid() && !
mDefault.isValid() )
57 const QString stringValue = input.toString();
58 if ( stringValue.isEmpty() || ( !input.isValid() &&
mDefault.userType() == QMetaType::Type::QString &&
mDefault.toString().isEmpty() ) )
61 const QStringList layerRows = stringValue.split(
"::|::"_L1 );
62 for (
const QString &row : layerRows )
64 if ( row.trimmed().isEmpty() )
67 const QStringList tokens = row.split(
"::~::"_L1 );
68 if ( tokens.count() < 4 )
@ Optional
Parameter is optional.
Contains information about the context in which a processing algorithm is executed.
Qgis::ProcessingParameterFlags mFlags
Parameter flags.
QString description() const
Returns the description for the parameter.
QgsProcessingParameterDefinition(const QString &name, const QString &description=QString(), const QVariant &defaultValue=QVariant(), bool optional=false, const QString &help=QString())
Constructor for QgsProcessingParameterDefinition.
QString name() const
Returns the name of the parameter.
QVariant mDefault
Default value for parameter.
static QString typeName()
Returns the type name for the parameter class.
bool checkValueIsAcceptable(const QVariant &input, QgsProcessingContext *context=nullptr) const override
Checks whether the specified input value is acceptable for the parameter.
QgsProcessingParameterInterpolationSource(const QString &name, const QString &description=QString())
Constructor for QgsProcessingParameterInterpolationSource.
QString type() const override
Unique parameter type name.
QgsProcessingParameterInterpolationSource * clone() const override
Creates a clone of the parameter definition.
QString asPythonString(QgsProcessing::PythonOutputType outputType=QgsProcessing::PythonOutputType::PythonQgsProcessingAlgorithmSubclass) const override
Returns the parameter definition as a Python command which can be used within a Python Processing scr...
static QString stringToPythonLiteral(const QString &string)
Converts a string to a Python string literal.
PythonOutputType
Available Python output types.
@ PythonQgsProcessingAlgorithmSubclass
Full Python QgsProcessingAlgorithm subclass.