26 , mDescription( description )
34 return QObject::tr(
"NULL" );
37 if ( value.type() == QVariant::String )
40 return value.toString();
84 if ( value.type() == QVariant::String && !value.toString().isEmpty() )
87 return QStringLiteral(
"<a href=\"%1\">%2</a>" ).arg( QUrl::fromLocalFile( value.toString() ).toString(), QDir::toNativeSeparators( value.toString() ) );
100 switch ( value.type() )
104 case QVariant::LongLong:
105 case QVariant::ULongLong:
106 case QVariant::Double:
108 return value.toString();
126 if ( value.type() == QVariant::Bool )
129 return value.toBool() ? QObject::tr(
"True" ) : QObject::tr(
"False" );
140 if ( value.type() == QVariant::String && !value.toString().isEmpty() )
143 return QStringLiteral(
"<a href=\"%1\">%2</a>" ).arg( QUrl::fromLocalFile( value.toString() ).toString(), QDir::toNativeSeparators( value.toString() ) );
155 if ( value.type() == QVariant::String && !value.toString().isEmpty() )
158 return QStringLiteral(
"<a href=\"%1\">%2</a>" ).arg( QUrl::fromLocalFile( value.toString() ).toString(), QDir::toNativeSeparators( value.toString() ) );
185 switch ( value.type() )
190 const QVariantList list = value.toList();
192 QStringList layerNames;
193 for (
const QVariant &v : list )
195 layerNames << v.toString();
197 return layerNames.join( QLatin1String(
", " ) );
200 case QVariant::StringList:
203 const QStringList list = value.toStringList();
204 return list.join( QLatin1String(
", " ) );
231 switch ( value.type() )
235 case QVariant::LongLong:
236 case QVariant::ULongLong:
237 case QVariant::Double:
239 return value.toString();
242 return value.toBool() ? QObject::tr(
"True" ) : QObject::tr(
"False" );
247 const QVariantList list = value.toList();
250 for (
const QVariant &v : list )
252 names << v.toString();
254 return names.join( QLatin1String(
", " ) );
257 case QVariant::StringList:
260 const QStringList list = value.toStringList();
261 return list.join( QLatin1String(
", " ) );
ProcessingSourceType
Processing data source types.
Contains information about the context in which a processing algorithm is executed.
QgsProcessingOutputBoolean(const QString &name, const QString &description=QString())
Constructor for QgsProcessingOutputNumber.
QString valueAsString(const QVariant &value, QgsProcessingContext &context, bool &ok) const override
Returns a string version of the parameter output value (if possible).
QgsProcessingOutputConditionalBranch(const QString &name, const QString &description=QString())
Constructor for QgsProcessingOutputConditionalBranch.
Base class for the definition of processing outputs.
virtual QString valueAsFormattedString(const QVariant &value, QgsProcessingContext &context, bool &ok) const
Returns a HTML string version of the parameter output value (if possible).
virtual QString valueAsString(const QVariant &value, QgsProcessingContext &context, bool &ok) const
Returns a string version of the parameter output value (if possible).
QgsProcessingOutputDefinition(const QString &name, const QString &description=QString())
Constructor for QgsProcessingOutputDefinition.
QString valueAsFormattedString(const QVariant &value, QgsProcessingContext &context, bool &ok) const override
Returns a HTML string version of the parameter output value (if possible).
QgsProcessingOutputFile(const QString &name, const QString &description=QString())
Constructor for QgsProcessingOutputFile.
QgsProcessingOutputFolder(const QString &name, const QString &description=QString())
Constructor for QgsProcessingOutputFolder.
QString valueAsFormattedString(const QVariant &value, QgsProcessingContext &context, bool &ok) const override
Returns a HTML string version of the parameter output value (if possible).
QgsProcessingOutputHtml(const QString &name, const QString &description=QString())
Constructor for QgsProcessingOutputHtml.
QString valueAsFormattedString(const QVariant &value, QgsProcessingContext &context, bool &ok) const override
Returns a HTML string version of the parameter output value (if possible).
static QString typeName()
Returns the type name for the output class.
QgsProcessingOutputMapLayer(const QString &name, const QString &description=QString())
Constructor for QgsProcessingOutputMapLayer.
QString type() const override
Unique output type name.
static QString typeName()
Returns the type name for the output class.
QgsProcessingOutputMultipleLayers(const QString &name, const QString &description=QString())
Constructor for QgsProcessingOutputMultipleLayers.
QString type() const override
Unique output type name.
QString valueAsString(const QVariant &value, QgsProcessingContext &context, bool &ok) const override
Returns a string version of the parameter output value (if possible).
QString valueAsString(const QVariant &value, QgsProcessingContext &context, bool &ok) const override
Returns a string version of the parameter output value (if possible).
QgsProcessingOutputNumber(const QString &name, const QString &description=QString())
Constructor for QgsProcessingOutputNumber.
QgsProcessingOutputPointCloudLayer(const QString &name, const QString &description=QString())
Constructor for QgsProcessingOutputPointCloudLayer.
QgsProcessingOutputRasterLayer(const QString &name, const QString &description=QString())
Constructor for QgsProcessingOutputRasterLayer.
QgsProcessingOutputString(const QString &name, const QString &description=QString())
Constructor for QgsProcessingOutputString.
static QString typeName()
Returns the type name for the output class.
QgsProcessingOutputVariant(const QString &name, const QString &description=QString())
Constructor for QgsProcessingOutputVariant.
QString type() const override
Unique output type name.
QString valueAsString(const QVariant &value, QgsProcessingContext &context, bool &ok) const override
Returns a string version of the parameter output value (if possible).
QgsProcessingOutputVectorLayer(const QString &name, const QString &description=QString(), Qgis::ProcessingSourceType type=Qgis::ProcessingSourceType::VectorAnyGeometry)
Constructor for QgsProcessingOutputVectorLayer.
QString type() const override
Unique output type name.
void setDataType(Qgis::ProcessingSourceType type)
Sets the layer type for the output layer.
Qgis::ProcessingSourceType dataType() const
Returns the layer type for the output layer.
QgsProcessingOutputVectorTileLayer(const QString &name, const QString &description=QString())
Constructor for QgsProcessingOutputVectorTileLayer.
static bool isNull(const QVariant &variant, bool silenceNullWarnings=false)
Returns true if the specified variant should be considered a NULL value.