QGIS API Documentation 3.28.0-Firenze (ed3ad0430f)
Public Member Functions | List of all members
QgsProcessingParameterWidgetContext Class Reference

Contains settings which reflect the context in which a Processing parameter 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...

#include <qgsprocessingwidgetwrapper.h>

Public Member Functions

 QgsProcessingParameterWidgetContext ()=default
 Constructor for QgsProcessingParameterWidgetContext. More...
 
QgsMapLayeractiveLayer () const
 Returns the current active layer. More...
 
QgsBrowserGuiModelbrowserModel () const
 Returns the browser model associated with the widget. More...
 
QgsMapCanvasmapCanvas () const
 Returns the map canvas associated with the widget. More...
 
QgsMessageBarmessageBar () const
 Returns the message bar associated with the widget. More...
 
QgsProcessingModelAlgorithm * model () const
 Returns the model which the parameter widget is associated with. More...
 
QString modelChildAlgorithmId () const
 Returns the child algorithm ID within the model which the parameter widget is associated with. More...
 
QgsProjectproject () const
 Returns the project associated with the widget. More...
 
void setActiveLayer (QgsMapLayer *layer)
 Sets the current active layer. More...
 
void setBrowserModel (QgsBrowserGuiModel *model)
 Sets the browser model associated with the widget. More...
 
void setMapCanvas (QgsMapCanvas *canvas)
 Sets the map canvas associated with the widget. More...
 
void setMessageBar (QgsMessageBar *bar)
 Sets the message bar associated with the widget. More...
 
void setModel (QgsProcessingModelAlgorithm *model)
 Sets the model which the parameter widget is associated with. More...
 
void setModelChildAlgorithmId (const QString &id)
 Sets the child algorithm id within the model which the parameter widget is associated with. More...
 
void setProject (QgsProject *project)
 Sets the project associated with the widget. More...
 

Detailed Description

Contains settings which reflect the context in which a Processing parameter 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.

Since
QGIS 3.4

Definition at line 115 of file qgsprocessingwidgetwrapper.h.

Constructor & Destructor Documentation

◆ QgsProcessingParameterWidgetContext()

QgsProcessingParameterWidgetContext::QgsProcessingParameterWidgetContext ( )
default

Member Function Documentation

◆ activeLayer()

QgsMapLayer * QgsProcessingParameterWidgetContext::activeLayer ( ) const

Returns the current active layer.

See also
setActiveLayer()
Since
QGIS 3.14

Definition at line 84 of file qgsprocessingwidgetwrapper.cpp.

◆ browserModel()

QgsBrowserGuiModel * QgsProcessingParameterWidgetContext::browserModel ( ) const

Returns the browser model associated with the widget.

See also
setBrowserModel()
Since
QGIS 3.12

Definition at line 59 of file qgsprocessingwidgetwrapper.cpp.

◆ mapCanvas()

QgsMapCanvas * QgsProcessingParameterWidgetContext::mapCanvas ( ) const

Returns the map canvas associated with the widget.

See also
setMapCanvas()

Definition at line 39 of file qgsprocessingwidgetwrapper.cpp.

◆ messageBar()

QgsMessageBar * QgsProcessingParameterWidgetContext::messageBar ( ) const

Returns the message bar associated with the widget.

This allows the widget to push feedback messages to the user.

See also
setMessageBar()
Since
QGIS 3.12

Definition at line 49 of file qgsprocessingwidgetwrapper.cpp.

◆ model()

QgsProcessingModelAlgorithm * QgsProcessingParameterWidgetContext::model ( ) const

Returns the model which the parameter widget is associated with.

See also
setModel()
modelChildAlgorithmId()

Definition at line 94 of file qgsprocessingwidgetwrapper.cpp.

◆ modelChildAlgorithmId()

QString QgsProcessingParameterWidgetContext::modelChildAlgorithmId ( ) const

Returns the child algorithm ID within the model which the parameter widget is associated with.

See also
setModelChildAlgorithmId()
model()

Definition at line 74 of file qgsprocessingwidgetwrapper.cpp.

◆ project()

QgsProject * QgsProcessingParameterWidgetContext::project ( ) const

Returns the project associated with the widget.

See also
setProject()

Definition at line 69 of file qgsprocessingwidgetwrapper.cpp.

◆ setActiveLayer()

void QgsProcessingParameterWidgetContext::setActiveLayer ( QgsMapLayer layer)

Sets the current active layer.

See also
activeLayer()
Since
QGIS 3.14

Definition at line 89 of file qgsprocessingwidgetwrapper.cpp.

◆ setBrowserModel()

void QgsProcessingParameterWidgetContext::setBrowserModel ( QgsBrowserGuiModel model)

Sets the browser model associated with the widget.

This will usually be the shared app instance of the browser model

See also
browserModel()
Since
QGIS 3.14

Definition at line 54 of file qgsprocessingwidgetwrapper.cpp.

◆ setMapCanvas()

void QgsProcessingParameterWidgetContext::setMapCanvas ( QgsMapCanvas canvas)

Sets the map canvas associated with the widget.

This allows the widget to retrieve the current map scale and other properties from the canvas.

See also
mapCanvas()

Definition at line 34 of file qgsprocessingwidgetwrapper.cpp.

◆ setMessageBar()

void QgsProcessingParameterWidgetContext::setMessageBar ( QgsMessageBar bar)

Sets the message bar associated with the widget.

This allows the widget to push feedback messages to the user.

See also
messageBar()
Since
QGIS 3.12

Definition at line 44 of file qgsprocessingwidgetwrapper.cpp.

◆ setModel()

void QgsProcessingParameterWidgetContext::setModel ( QgsProcessingModelAlgorithm *  model)

Sets the model which the parameter widget is associated with.

See also
model()
setModelChildAlgorithmId()

Definition at line 99 of file qgsprocessingwidgetwrapper.cpp.

◆ setModelChildAlgorithmId()

void QgsProcessingParameterWidgetContext::setModelChildAlgorithmId ( const QString &  id)

Sets the child algorithm id within the model which the parameter widget is associated with.

See also
modelChildAlgorithmId()
setModel()

Definition at line 79 of file qgsprocessingwidgetwrapper.cpp.

◆ setProject()

void QgsProcessingParameterWidgetContext::setProject ( QgsProject project)

Sets the project associated with the widget.

This allows the widget to retrieve the map layers and other properties from the correct project.

See also
project()
Since
QGIS 3.8

Definition at line 64 of file qgsprocessingwidgetwrapper.cpp.


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