26using namespace Qt::StringLiterals;
38 return QObject::tr(
"NULL" );
41 if ( value.userType() == QMetaType::Type::QString )
44 return value.toString();
57 return QColor( 128, 128, 128 );
77 return QColor( 122, 0, 47 );
86 return QColor( 0, 180, 180 );
99 return QColor( 137, 150, 171 );
108 if ( value.userType() == QMetaType::Type::QString && !value.toString().isEmpty() )
111 return u
"<a href=\"%1\">%2</a>"_s.arg( QUrl::fromLocalFile( value.toString() ).toString(), QDir::toNativeSeparators( value.toString() ) );
119 return QColor( 255, 131, 23 );
129 switch ( value.userType() )
131 case QMetaType::Type::Int:
132 case QMetaType::Type::UInt:
133 case QMetaType::Type::LongLong:
134 case QMetaType::Type::ULongLong:
135 case QMetaType::Type::Double:
137 return value.toString();
146 return QColor( 34, 157, 214 );
155 return QColor( 255, 131, 23 );
165 if ( value.userType() == QMetaType::Type::Bool )
168 return value.toBool() ? QObject::tr(
"True" ) : QObject::tr(
"False" );
175 return QColor( 51, 201, 28 );
184 if ( value.userType() == QMetaType::Type::QString && !value.toString().isEmpty() )
187 return u
"<a href=\"%1\">%2</a>"_s.arg( QUrl::fromLocalFile( value.toString() ).toString(), QDir::toNativeSeparators( value.toString() ) );
195 return QColor( 80, 80, 80 );
204 if ( value.userType() == QMetaType::Type::QString && !value.toString().isEmpty() )
207 return u
"<a href=\"%1\">%2</a>"_s.arg( QUrl::fromLocalFile( value.toString() ).toString(), QDir::toNativeSeparators( value.toString() ) );
215 return QColor( 80, 80, 80 );
229 return QColor( 137, 150, 171 );
244 switch ( value.userType() )
246 case QMetaType::Type::QVariantList:
249 const QVariantList list = value.toList();
251 QStringList layerNames;
252 for (
const QVariant &v : list )
254 layerNames << v.toString();
256 return layerNames.join(
", "_L1 );
259 case QMetaType::Type::QStringList:
262 const QStringList list = value.toStringList();
263 return list.join(
", "_L1 );
274 return QColor( 137, 150, 171 );
295 switch ( value.userType() )
297 case QMetaType::Type::Int:
298 case QMetaType::Type::UInt:
299 case QMetaType::Type::LongLong:
300 case QMetaType::Type::ULongLong:
301 case QMetaType::Type::Double:
303 return value.toString();
304 case QMetaType::Type::Bool:
306 return value.toBool() ? QObject::tr(
"True" ) : QObject::tr(
"False" );
308 case QMetaType::Type::QVariantList:
311 const QVariantList list = value.toList();
314 for (
const QVariant &v : list )
316 names << v.toString();
318 return names.join(
", "_L1 );
321 case QMetaType::Type::QStringList:
324 const QStringList list = value.toStringList();
325 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).
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.
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).
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.
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.
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.
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.