26 , mDescription( description )
34 return QObject::tr(
"NULL" );
37 if ( value.userType() == QMetaType::Type::QString )
40 return value.toString();
84 if ( value.userType() == QMetaType::Type::QString && !value.toString().isEmpty() )
87 return QStringLiteral(
"<a href=\"%1\">%2</a>" ).arg( QUrl::fromLocalFile( value.toString() ).toString(), QDir::toNativeSeparators( value.toString() ) );
100 switch ( value.userType() )
102 case QMetaType::Type::Int:
103 case QMetaType::Type::UInt:
104 case QMetaType::Type::LongLong:
105 case QMetaType::Type::ULongLong:
106 case QMetaType::Type::Double:
108 return value.toString();
126 if ( value.userType() == QMetaType::Type::Bool )
129 return value.toBool() ? QObject::tr(
"True" ) : QObject::tr(
"False" );
140 if ( value.userType() == QMetaType::Type::QString && !value.toString().isEmpty() )
143 return QStringLiteral(
"<a href=\"%1\">%2</a>" ).arg( QUrl::fromLocalFile( value.toString() ).toString(), QDir::toNativeSeparators( value.toString() ) );
155 if ( value.userType() == QMetaType::Type::QString && !value.toString().isEmpty() )
158 return QStringLiteral(
"<a href=\"%1\">%2</a>" ).arg( QUrl::fromLocalFile( value.toString() ).toString(), QDir::toNativeSeparators( value.toString() ) );
185 switch ( value.userType() )
187 case QMetaType::Type::QVariantList:
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 QMetaType::Type::QStringList:
203 const QStringList list = value.toStringList();
204 return list.join( QLatin1String(
", " ) );
231 switch ( value.userType() )
233 case QMetaType::Type::Int:
234 case QMetaType::Type::UInt:
235 case QMetaType::Type::LongLong:
236 case QMetaType::Type::ULongLong:
237 case QMetaType::Type::Double:
239 return value.toString();
240 case QMetaType::Type::Bool:
242 return value.toBool() ? QObject::tr(
"True" ) : QObject::tr(
"False" );
244 case QMetaType::Type::QVariantList:
247 const QVariantList list = value.toList();
250 for (
const QVariant &v : list )
252 names << v.toString();
254 return names.join( QLatin1String(
", " ) );
257 case QMetaType::Type::QStringList:
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.