QGIS API Documentation 3.39.0-Master (67e056379ed)
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
QgsProcessingOutputDefinition Class Referenceabstract

Base class for the definition of processing outputs. More...

#include <qgsprocessingoutputs.h>

Inheritance diagram for QgsProcessingOutputDefinition:
Inheritance graph
[legend]

Public Member Functions

 QgsProcessingOutputDefinition (const QString &name, const QString &description=QString())
 Constructor for QgsProcessingOutputDefinition.
 
virtual ~QgsProcessingOutputDefinition ()=default
 
bool autoCreated () const
 Returns true if the output was automatically created when adding a parameter.
 
QString description () const
 Returns the description for the output.
 
QString name () const
 Returns the name of the output.
 
void setAutoCreated (bool autoCreated)
 Sets whether an output was automatically created when adding a parameter.
 
void setDescription (const QString &description)
 Sets the description for the output.
 
void setName (const QString &name)
 Sets the name of the output.
 
virtual QString type () const =0
 Unique output type name.
 
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).
 

Protected Attributes

bool mAutoCreated = false
 
QString mDescription
 Output description.
 
QString mName
 Output name.
 

Detailed Description

Base class for the definition of processing outputs.

Output definitions encapsulate the properties regarding the outputs from algorithms, such as generated layers or calculated values.

Definition at line 41 of file qgsprocessingoutputs.h.

Constructor & Destructor Documentation

◆ QgsProcessingOutputDefinition()

QgsProcessingOutputDefinition::QgsProcessingOutputDefinition ( const QString &  name,
const QString &  description = QString() 
)

Constructor for QgsProcessingOutputDefinition.

Definition at line 24 of file qgsprocessingoutputs.cpp.

◆ ~QgsProcessingOutputDefinition()

virtual QgsProcessingOutputDefinition::~QgsProcessingOutputDefinition ( )
virtualdefault

Member Function Documentation

◆ autoCreated()

bool QgsProcessingOutputDefinition::autoCreated ( ) const
inline

Returns true if the output was automatically created when adding a parameter.

See also
setAutoCreated()
Since
QGIS 3.14

Definition at line 134 of file qgsprocessingoutputs.h.

◆ description()

QString QgsProcessingOutputDefinition::description ( ) const
inline

Returns the description for the output.

This is the user-visible string used to identify this output.

See also
setDescription()

Definition at line 112 of file qgsprocessingoutputs.h.

◆ name()

QString QgsProcessingOutputDefinition::name ( ) const
inline

Returns the name of the output.

This is the internal identifier by which algorithms access this output.

See also
setName()

Definition at line 98 of file qgsprocessingoutputs.h.

◆ setAutoCreated()

void QgsProcessingOutputDefinition::setAutoCreated ( bool  autoCreated)
inline

Sets whether an output was automatically created when adding a parameter.

Parameters
autoCreatedset to true if the output is to be considered as automatically created.
See also
autoCreated()
Since
QGIS 3.14

Definition at line 127 of file qgsprocessingoutputs.h.

◆ setDescription()

void QgsProcessingOutputDefinition::setDescription ( const QString &  description)
inline

Sets the description for the output.

This is the user-visible string used to identify this output.

See also
description()

Definition at line 119 of file qgsprocessingoutputs.h.

◆ setName()

void QgsProcessingOutputDefinition::setName ( const QString &  name)
inline

Sets the name of the output.

This is the internal identifier by which algorithms access this output.

See also
name()

Definition at line 105 of file qgsprocessingoutputs.h.

◆ type()

virtual QString QgsProcessingOutputDefinition::type ( ) const
pure virtual

◆ valueAsFormattedString()

QString QgsProcessingOutputDefinition::valueAsFormattedString ( const QVariant &  value,
QgsProcessingContext context,
bool &  ok 
) const
virtual

Returns a HTML string version of the parameter output value (if possible).

By default this will return the same value as valueAsString().

Parameters
valuevalue to convert
contextprocessing context
okwill be set to true if value could be represented as a string.
Returns
value converted to string
See also
valueAsString()
Since
QGIS 3.36

Reimplemented in QgsProcessingOutputHtml, QgsProcessingOutputFolder, and QgsProcessingOutputFile.

Definition at line 46 of file qgsprocessingoutputs.cpp.

◆ valueAsString()

QString QgsProcessingOutputDefinition::valueAsString ( const QVariant &  value,
QgsProcessingContext context,
bool &  ok 
) const
virtual

Returns a string version of the parameter output value (if possible).

Parameters
valuevalue to convert
contextprocessing context
okwill be set to true if value could be represented as a string.
Returns
value converted to string
See also
valueAsFormattedString()
Since
QGIS 3.36

Reimplemented in QgsProcessingOutputMultipleLayers, QgsProcessingOutputVariant, QgsProcessingOutputNumber, and QgsProcessingOutputBoolean.

Definition at line 29 of file qgsprocessingoutputs.cpp.

Member Data Documentation

◆ mAutoCreated

bool QgsProcessingOutputDefinition::mAutoCreated = false
protected

Definition at line 174 of file qgsprocessingoutputs.h.

◆ mDescription

QString QgsProcessingOutputDefinition::mDescription
protected

Output description.

Definition at line 172 of file qgsprocessingoutputs.h.

◆ mName

QString QgsProcessingOutputDefinition::mName
protected

Output name.

Definition at line 169 of file qgsprocessingoutputs.h.


The documentation for this class was generated from the following files: