Class: QgsProcessingParameterDefinitionDialog

A dialog which allow users to specify the properties of a Processing parameter.

Added in version 3.10.

Class Hierarchy

Inheritance diagram of qgis.gui.QgsProcessingParameterDefinitionDialog

Base classes

QDialog

QWidget

QObject

QPaintDevice

Methods

commentColor

Returns the color for the comments for the parameter.

comments

Returns the comments for the parameter.

createParameter

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

registerProcessingContextGenerator

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

setCommentColor

Sets the color for the comments for the parameter.

setComments

Sets the comments for the parameter.

switchToCommentTab

Switches the dialog to the comments tab.

class qgis.gui.QgsProcessingParameterDefinitionDialog[source]

Bases: QDialog

__init__(type: str | None, context: QgsProcessingContext, widgetContext: QgsProcessingParameterWidgetContext, definition: QgsProcessingParameterDefinition | None = None, algorithm: QgsProcessingAlgorithm | None = None, parent: QWidget | None = None)

Constructor for QgsProcessingParameterDefinitionDialog, for a parameter of the specified type.

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 dialog’s state.

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

Parameters:
commentColor(self) QColor[source]

Returns the color for the comments for the parameter.

Added in version 3.14.

Return type:

QColor

comments(self) str[source]

Returns the comments for the parameter.

See also

setComments()

Added in version 3.14.

Return type:

str

createParameter(self, name: str | None = '') QgsProcessingParameterDefinition | None[source]

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

The name parameter specifies the name for the newly created parameter.

Parameters:

name (Optional[str] = '')

Return type:

Optional[QgsProcessingParameterDefinition]

registerProcessingContextGenerator(self, generator: QgsProcessingContextGenerator | None)[source]

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

Added in version 3.18.

Parameters:

generator (Optional[QgsProcessingContextGenerator])

setCommentColor(self, color: QColor | Qt.GlobalColor)[source]

Sets the color for the comments for the parameter.

See also

commentColor()

Added in version 3.14.

Parameters:

color (Union[QColor, Qt.GlobalColor])

setComments(self, comments: str | None)[source]

Sets the comments for the parameter.

See also

comments()

Added in version 3.14.

Parameters:

comments (Optional[str])

switchToCommentTab(self)[source]

Switches the dialog to the comments tab.