26using namespace Qt::StringLiterals;
38 return QObject::tr(
"NULL" );
41 if ( value.userType() == QMetaType::Type::QString )
44 return value.toString();
62 return QColor( 128, 128, 128 );
82 return QColor( 122, 0, 47 );
96 return QColor( 0, 180, 180 );
119 return QColor( 137, 150, 171 );
133 if ( value.userType() == QMetaType::Type::QString && !value.toString().isEmpty() )
136 return u
"<a href=\"%1\">%2</a>"_s.arg( QUrl::fromLocalFile( value.toString() ).toString(), QDir::toNativeSeparators( value.toString() ) );
144 return QColor( 255, 131, 23 );
154 switch ( value.userType() )
156 case QMetaType::Type::Int:
157 case QMetaType::Type::UInt:
158 case QMetaType::Type::LongLong:
159 case QMetaType::Type::ULongLong:
160 case QMetaType::Type::Double:
162 return value.toString();
171 return QColor( 34, 157, 214 );
180 return QColor( 255, 131, 23 );
190 if ( value.userType() == QMetaType::Type::Bool )
193 return value.toBool() ? QObject::tr(
"True" ) : QObject::tr(
"False" );
200 return QColor( 51, 201, 28 );
209 if ( value.userType() == QMetaType::Type::QString && !value.toString().isEmpty() )
212 return u
"<a href=\"%1\">%2</a>"_s.arg( QUrl::fromLocalFile( value.toString() ).toString(), QDir::toNativeSeparators( value.toString() ) );
220 return QColor( 80, 80, 80 );
229 if ( value.userType() == QMetaType::Type::QString && !value.toString().isEmpty() )
232 return u
"<a href=\"%1\">%2</a>"_s.arg( QUrl::fromLocalFile( value.toString() ).toString(), QDir::toNativeSeparators( value.toString() ) );
240 return QColor( 80, 80, 80 );
259 return QColor( 137, 150, 171 );
274 switch ( value.userType() )
276 case QMetaType::Type::QVariantList:
279 const QVariantList list = value.toList();
281 QStringList layerNames;
282 for (
const QVariant &v : list )
284 layerNames << v.toString();
286 return layerNames.join(
", "_L1 );
289 case QMetaType::Type::QStringList:
292 const QStringList list = value.toStringList();
293 return list.join(
", "_L1 );
309 return QColor( 137, 150, 171 );
328 switch ( value.userType() )
330 case QMetaType::Type::Int:
331 case QMetaType::Type::UInt:
332 case QMetaType::Type::LongLong:
333 case QMetaType::Type::ULongLong:
334 case QMetaType::Type::Double:
336 return value.toString();
337 case QMetaType::Type::Bool:
339 return value.toBool() ? QObject::tr(
"True" ) : QObject::tr(
"False" );
341 case QMetaType::Type::QVariantList:
344 const QVariantList list = value.toList();
347 for (
const QVariant &v : list )
349 names << v.toString();
351 return names.join(
", "_L1 );
354 case QMetaType::Type::QStringList:
357 const QStringList list = value.toStringList();
358 return list.join(
", "_L1 );
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).
QColor modelColor() const override
Returns the color to use for the output in the model designer canvas.
QgsProcessingOutputConditionalBranch(const QString &name, const QString &description=QString())
Constructor for QgsProcessingOutputConditionalBranch.
QString name() const
Returns the name of the output.
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).
virtual bool isMapLayer() const
Returns true if the output is a map layer type.
QgsProcessingOutputDefinition(const QString &name, const QString &description=QString())
Constructor for QgsProcessingOutputDefinition.
virtual QColor modelColor() const
Returns the color to use for the output in the model designer canvas.
QString mName
Output name.
QString mDescription
Output description.
QString description() const
Returns the description for the output.
QString valueAsFormattedString(const QVariant &value, QgsProcessingContext &context, bool &ok) const override
Returns a HTML string version of the parameter output value (if possible).
QColor modelColor() const override
Returns the color to use for the output in the model designer canvas.
QgsProcessingOutputFile(const QString &name, const QString &description=QString())
Constructor for QgsProcessingOutputFile.
QColor modelColor() const override
Returns the color to use for the output in the model designer canvas.
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).
QColor modelColor() const override
Returns the color to use for the output in the model designer canvas.
static QString typeName()
Returns the type name for the output class.
QColor modelColor() const override
Returns the color to use for the output in the model designer canvas.
bool isMapLayer() const override
Returns true if the output is a map layer type.
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.
QColor modelColor() const override
Returns the color to use for the output in the model designer canvas.
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).
bool isMapLayer() const override
Returns true if the output is a map layer type.
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.
QColor modelColor() const override
Returns the color to use for the output in the model designer canvas.
QgsProcessingOutputPointCloudLayer(const QString &name, const QString &description=QString())
Constructor for QgsProcessingOutputPointCloudLayer.
bool isMapLayer() const override
Returns true if the output is a map layer type.
bool isMapLayer() const override
Returns true if the output is a map layer type.
QColor modelColor() const override
Returns the color to use for the output in the model designer canvas.
QgsProcessingOutputRasterLayer(const QString &name, const QString &description=QString())
Constructor for QgsProcessingOutputRasterLayer.
QgsProcessingOutputString(const QString &name, const QString &description=QString())
Constructor for QgsProcessingOutputString.
QColor modelColor() const override
Returns the color to use for the output in the model designer canvas.
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.
bool isMapLayer() const override
Returns true if the output is a map layer type.
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.
QColor modelColor() const override
Returns the color to use for the output in the model designer canvas.
bool isMapLayer() const override
Returns true if the output is a map layer type.
QgsProcessingOutputVectorTileLayer(const QString &name, const QString &description=QString())
Constructor for QgsProcessingOutputVectorTileLayer.
QColor modelColor() const override
Returns the color to use for the output in the model designer canvas.
static bool isNull(const QVariant &variant, bool silenceNullWarnings=false)
Returns true if the specified variant should be considered a NULL value.