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¶
Enums
Custom model roles. |
|
alias of |
Methods
Returns the algorithm which corresponds to a given index, or |
|
Returns the model node corresponding to the given index. |
|
Returns the index corresponding to the specified providerId. |
|
Returns the index corresponding to the parent of a given node. |
|
Returns |
|
Returns the model index corresponding to the given node. |
|
Returns the provider which corresponds to a given index, or |
|
Returns the provider ID which corresponds to a given index, or an empty string if the index does not represent a provider. |
Signals
Emitted whenever favorite algorithms are added to the model. |
|
Emitted whenever recent algorithms are added to the model. |
- 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
parent
object.If
registry
is 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
recentLog
is specified then it will be used to create a “Recently used” top level group containing recently used algorithms.If
favoriteManager
is 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:
IntEnum
Custom 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.RoleNodeType
in older QGIS releases.AlgorithmFlags
: Returns the node’s algorithm flags, for algorithm nodesAvailable as
QgsProcessingToolboxModel.RoleAlgorithmFlags
in older QGIS releases.AlgorithmId
: Algorithm ID, for algorithm nodesAvailable as
QgsProcessingToolboxModel.RoleAlgorithmId
in older QGIS releases.AlgorithmName
: Untranslated algorithm name, for algorithm nodesAvailable as
QgsProcessingToolboxModel.RoleAlgorithmName
in older QGIS releases.AlgorithmShortDescription
: Short algorithm description, for algorithm nodesAvailable as
QgsProcessingToolboxModel.RoleAlgorithmShortDescription
in older QGIS releases.AlgorithmTags
: List of algorithm tags, for algorithm nodesAvailable as
QgsProcessingToolboxModel.RoleAlgorithmTags
in older QGIS releases.ProviderFlags
: Returns the node’s provider flagsAvailable as
QgsProcessingToolboxModel.RoleProviderFlags
in older QGIS releases.
- Roles¶
alias of
CustomRole
- algorithmForIndex(self, index: QModelIndex) QgsProcessingAlgorithm | None [source]¶
Returns the algorithm which corresponds to a given
index
, orNone
if the index does not represent an algorithm.See also
See also
- Parameters:
index (QModelIndex)
- Return type:
Optional[QgsProcessingAlgorithm]
- 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
True
ifindex
corresponds to an algorithm.See also
- 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
- providerForIndex(self, index: QModelIndex) QgsProcessingProvider | None [source]¶
Returns the provider which corresponds to a given
index
, orNone
if the index does not represent a provider.See also
See also
- Parameters:
index (QModelIndex)
- Return type:
Optional[QgsProcessingProvider]