QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
Public Member Functions | List of all members
QgsProcessingAbstractParameterDefinitionWidget Class Referenceabstract

Abstract base class for widgets which allow users to specify the properties of a Processing parameter. More...

#include <qgsprocessingparameterdefinitionwidget.h>

Inheritance diagram for QgsProcessingAbstractParameterDefinitionWidget:
Inheritance graph
[legend]

Public Member Functions

 QgsProcessingAbstractParameterDefinitionWidget (QgsProcessingContext &context, const QgsProcessingParameterWidgetContext &widgetContext, const QgsProcessingParameterDefinition *definition=nullptr, const QgsProcessingAlgorithm *algorithm=nullptr, QWidget *parent=nullptr)
 Creates a new QgsProcessingAbstractParameterDefinitionWidget, with the specified parent widget. More...
 
QgsExpressionContext createExpressionContext () const override
 This method needs to be reimplemented in all classes which implement this interface and return an expression context. More...
 
virtual QgsProcessingParameterDefinitioncreateParameter (const QString &name, const QString &description, Qgis::ProcessingParameterFlags flags) const =0
 Returns a new instance of a parameter definition, using the current settings defined in the dialog. More...
 
void registerProcessingContextGenerator (QgsProcessingContextGenerator *generator)
 Registers a Processing context generator class that will be used to retrieve a Processing context for the widget when required. More...
 
virtual void setWidgetContext (const QgsProcessingParameterWidgetContext &context)
 Sets the context in which the Processing definition widget is shown, e.g., the parent model algorithm, a linked map canvas, and other relevant information which allows the widget to fine-tune its behavior. More...
 
const QgsProcessingParameterWidgetContextwidgetContext () const
 Returns the context in which the Processing definition widget is shown, e.g., the parent model algorithm, a linked map canvas, and other relevant information which allows the widget to fine-tune its behavior. More...
 
- Public Member Functions inherited from QgsExpressionContextGenerator
virtual ~QgsExpressionContextGenerator ()=default
 
virtual QgsExpressionContext createExpressionContext () const =0
 This method needs to be reimplemented in all classes which implement this interface and return an expression context. More...
 

Detailed Description

Abstract base class for widgets which allow users to specify the properties of a Processing parameter.

Since
QGIS 3.10

Definition at line 46 of file qgsprocessingparameterdefinitionwidget.h.

Constructor & Destructor Documentation

◆ QgsProcessingAbstractParameterDefinitionWidget()

QgsProcessingAbstractParameterDefinitionWidget::QgsProcessingAbstractParameterDefinitionWidget ( QgsProcessingContext context,
const QgsProcessingParameterWidgetContext widgetContext,
const QgsProcessingParameterDefinition definition = nullptr,
const QgsProcessingAlgorithm algorithm = nullptr,
QWidget *  parent = nullptr 
)

Creates a new QgsProcessingAbstractParameterDefinitionWidget, with the specified parent widget.

The context argument must specify a Processing context, which will be used by the widget to evaluate existing definition properties such as default values. Similarly, the widgetContext argument specifies the wider GUI context in which the widget will be used.

The optional definition argument may be used to provide a parameter definition to use to initially populate the widget's state.

Additionally, the optional algorithm parameter may be used to specify the algorithm or model associated with the parameter.

Definition at line 36 of file qgsprocessingparameterdefinitionwidget.cpp.

Member Function Documentation

◆ createExpressionContext()

QgsExpressionContext QgsProcessingAbstractParameterDefinitionWidget::createExpressionContext ( ) const
overridevirtual

This method needs to be reimplemented in all classes which implement this interface and return an expression context.

Implements QgsExpressionContextGenerator.

Definition at line 61 of file qgsprocessingparameterdefinitionwidget.cpp.

◆ createParameter()

virtual QgsProcessingParameterDefinition * QgsProcessingAbstractParameterDefinitionWidget::createParameter ( const QString &  name,
const QString &  description,
Qgis::ProcessingParameterFlags  flags 
) const
pure virtual

Returns a new instance of a parameter definition, using the current settings defined in the dialog.

Common properties for parameters, including the name, description, and parameter flags are passed to the method. Subclass implementations must use these properties when crafting a parameter definition which also respects the additional properties specific to the parameter type handled by the widget subclass.

◆ registerProcessingContextGenerator()

void QgsProcessingAbstractParameterDefinitionWidget::registerProcessingContextGenerator ( QgsProcessingContextGenerator generator)

Registers a Processing context generator class that will be used to retrieve a Processing context for the widget when required.

Since
QGIS 3.18

Definition at line 56 of file qgsprocessingparameterdefinitionwidget.cpp.

◆ setWidgetContext()

void QgsProcessingAbstractParameterDefinitionWidget::setWidgetContext ( const QgsProcessingParameterWidgetContext context)
virtual

Sets the context in which the Processing definition widget is shown, e.g., the parent model algorithm, a linked map canvas, and other relevant information which allows the widget to fine-tune its behavior.

Subclasses should take care to call the base class method when reimplementing this method.

See also
widgetContext()
Since
QGIS 3.18

Definition at line 46 of file qgsprocessingparameterdefinitionwidget.cpp.

◆ widgetContext()

const QgsProcessingParameterWidgetContext & QgsProcessingAbstractParameterDefinitionWidget::widgetContext ( ) const

Returns the context in which the Processing definition widget is shown, e.g., the parent model algorithm, a linked map canvas, and other relevant information which allows the widget to fine-tune its behavior.

See also
setWidgetContext()
Since
QGIS 3.18

Definition at line 51 of file qgsprocessingparameterdefinitionwidget.cpp.


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