Class: QgsProcessingToolboxModel¶
A model for providers and algorithms shown within the Processing toolbox.
See QgsProcessingToolboxProxyModel for a sorted, filterable
version of this model.
Added in version 3.4.
Class Hierarchy¶
Base classes¶
- class qgis.gui.QgsProcessingToolboxModel[source]¶
Bases:
QAbstractItemModel- __init__(parent: QObject | None = None, registry: QgsProcessingRegistry | None = None, recentLog: QgsProcessingRecentAlgorithmLog | None = None, favoriteManager: QgsProcessingFavoriteAlgorithmManager | None = None)
Constructor for QgsProcessingToolboxModel, with the given
parentobject.If
registryis specified then the model will show providers and algorithms from the given registry. If no registry is specified, then the processing registry attached toQgsApplication.processingRegistry()will be used by the model.If
recentLogis specified then it will be used to create a “Recently used” top level group containing recently used algorithms.If
favoriteManageris specified then it will be used to create a “Favorites” top level group containing favorite algorithms. Since QGIS 3.40- Parameters:
parent (Optional[QObject] = None)
registry (Optional[QgsProcessingRegistry] = None)
recentLog (Optional[QgsProcessingRecentAlgorithmLog] = None)
favoriteManager (Optional[QgsProcessingFavoriteAlgorithmManager] = None)
- class CustomRole(*values)¶
Bases:
IntEnumCustom model roles.
Note
Prior to QGIS 3.36 this was available as QgsProcessingToolboxModel.Roles
Added in version 3.36.
NodeType: Corresponds to the node’s typeAvailable as
QgsProcessingToolboxModel.RoleNodeTypein older QGIS releases.AlgorithmFlags: Returns the node’s algorithm flags, for algorithm nodesAvailable as
QgsProcessingToolboxModel.RoleAlgorithmFlagsin older QGIS releases.AlgorithmId: Algorithm ID, for algorithm nodesAvailable as
QgsProcessingToolboxModel.RoleAlgorithmIdin older QGIS releases.AlgorithmName: Untranslated algorithm name, for algorithm nodesAvailable as
QgsProcessingToolboxModel.RoleAlgorithmNamein older QGIS releases.AlgorithmShortDescription: Short algorithm description, for algorithm nodesAvailable as
QgsProcessingToolboxModel.RoleAlgorithmShortDescriptionin older QGIS releases.AlgorithmTags: List of algorithm tags, for algorithm nodesAvailable as
QgsProcessingToolboxModel.RoleAlgorithmTagsin older QGIS releases.ProviderFlags: Returns the node’s provider flagsAvailable as
QgsProcessingToolboxModel.RoleProviderFlagsin older QGIS releases.ParameterTypeId: Untranslated parameter type unique identifier for parameter nodesAdded in version 3.44.
- Roles¶
alias of
CustomRole
- algorithmForIndex(self, index: QModelIndex) QgsProcessingAlgorithm | None[source]¶
Returns the algorithm which corresponds to a given
index, orNoneif the index does not represent an algorithm.See also
See also
- Parameters:
index (QModelIndex)
- Return type:
Optional[QgsProcessingAlgorithm]
- signal favoriteAlgorithmAdded[source]¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- index2node(self, index: QModelIndex) QgsProcessingToolboxModelNode | None[source]¶
Returns the model node corresponding to the given
index.See also
- Parameters:
index (QModelIndex)
- Return type:
Optional[QgsProcessingToolboxModelNode]
- indexForProvider(self, providerId: str | None) QModelIndex[source]¶
Returns the index corresponding to the specified
providerId.See also
- Parameters:
providerId (Optional[str])
- Return type:
QModelIndex
- indexOfParentTreeNode(self, parentNode: QgsProcessingToolboxModelNode | None) QModelIndex[source]¶
Returns the index corresponding to the parent of a given node.
- Parameters:
parentNode (Optional[QgsProcessingToolboxModelNode])
- Return type:
QModelIndex
- isAlgorithm(self, index: QModelIndex) bool[source]¶
Returns
Trueifindexcorresponds to an algorithm.See also
- Parameters:
index (QModelIndex)
- Return type:
bool
- isParameter(self, index: QModelIndex) bool[source]¶
Returns
Trueifindexcorresponds to a parameter.See also
Added in version 3.44.
- Parameters:
index (QModelIndex)
- Return type:
bool
- node2index(self, node: QgsProcessingToolboxModelNode | None) QModelIndex[source]¶
Returns the model index corresponding to the given
node.See also
- Parameters:
node (Optional[QgsProcessingToolboxModelNode])
- Return type:
QModelIndex
- parameterTypeForIndex(self, index: QModelIndex) QgsProcessingParameterType | None[source]¶
Returns the algorithm which corresponds to a given
index, orNoneif the index does not represent an algorithm.See also
See also
Added in version 3.44.
- Parameters:
index (QModelIndex)
- Return type:
Optional[QgsProcessingParameterType]
- providerForIndex(self, index: QModelIndex) QgsProcessingProvider | None[source]¶
Returns the provider which corresponds to a given
index, orNoneif the index does not represent a provider.See also
See also
- Parameters:
index (QModelIndex)
- Return type:
Optional[QgsProcessingProvider]
- providerIdForIndex(self, index: QModelIndex) str[source]¶
Returns the provider ID which corresponds to a given
index, or an empty string if the index does not represent a provider.See also
See also
- Parameters:
index (QModelIndex)
- Return type:
str
- signal recentAlgorithmAdded[source]¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.