Class: QgsProcessingToolboxModel¶
- class qgis.gui.QgsProcessingToolboxModel¶
Bases:
PyQt5.QtCore.QAbstractItemModel
A model for providers and algorithms shown within the Processing toolbox.
See
QgsProcessingToolboxProxyModel
for a sorted, filterable version of this model.New in version 3.4.
QgsProcessingToolboxModel(parent: QObject = None, registry:
QgsProcessingRegistry
= None, recentLog:QgsProcessingRecentAlgorithmLog
= None) Constructor forQgsProcessingToolboxModel
, with the givenparent
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.Enums
Bases:
enum.IntEnum
alias of
CustomRole
Methods
Returns the algorithm which corresponds to a given
index
, orNone
if the index does not represent an algorithm.- rtype:
int
- param index:
- param index:
- param row:
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
True
ifindex
corresponds to an algorithm.- param indexes:
Returns the model index corresponding to the given
node
.- param index:
Returns the provider which corresponds to a given
index
, orNone
if the index does not represent a provider.Returns the provider ID which corresponds to a given
index
, or an empty string if the index does not represent a provider.- param parent:
Signals
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
- class CustomRole(value)¶
Bases:
enum.IntEnum
Custom model roles.
Note
Prior to QGIS 3.36 this was available as QgsProcessingToolboxModel.Roles
New in version 3.36.
RoleNodeType
: Corresponds to the node’s typeRoleAlgorithmFlags
: Returns the node’s algorithm flags, for algorithm nodesRoleAlgorithmId
: Algorithm ID, for algorithm nodesRoleAlgorithmName
: Untranslated algorithm name, for algorithm nodesRoleAlgorithmShortDescription
: Short algorithm description, for algorithm nodesRoleAlgorithmTags
: List of algorithm tags, for algorithm nodesRoleProviderFlags
: Returns the node’s provider flags
- baseClass¶
alias of
QgsProcessingToolboxModel
- Roles¶
alias of
CustomRole
- algorithmForIndex(self, index: QModelIndex) QgsProcessingAlgorithm ¶
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:
- beginInsertColumns(self, QModelIndex, int, int)¶
- beginInsertRows(self, QModelIndex, int, int)¶
- beginMoveColumns(self, QModelIndex, int, int, QModelIndex, int) bool ¶
- beginMoveRows(self, QModelIndex, int, int, QModelIndex, int) bool ¶
- beginRemoveColumns(self, QModelIndex, int, int)¶
- beginRemoveRows(self, QModelIndex, int, int)¶
- beginResetModel(self)¶
- changePersistentIndex(self, QModelIndex, QModelIndex)¶
- changePersistentIndexList(self, Iterable[QModelIndex], Iterable[QModelIndex])¶
- childEvent(self, QChildEvent)¶
- columnCount(self, QModelIndex=QModelIndex()) int ¶
- Return type:
int
- connectNotify(self, QMetaMethod)¶
- createIndex(self, int, int, object: object = 0) QModelIndex ¶
- customEvent(self, QEvent)¶
- data(self, index: QModelIndex, role: int = Qt.DisplayRole) Any ¶
- Parameters:
index (QModelIndex) –
role (int = Qt.DisplayRole) –
- Return type:
Any
- decodeData(self, int, int, QModelIndex, QDataStream) bool ¶
- disconnectNotify(self, QMetaMethod)¶
- encodeData(self, Iterable[QModelIndex], QDataStream)¶
- endInsertColumns(self)¶
- endInsertRows(self)¶
- endMoveColumns(self)¶
- endMoveRows(self)¶
- endRemoveColumns(self)¶
- endRemoveRows(self)¶
- endResetModel(self)¶
- flags(self, index: QModelIndex) Qt.ItemFlags ¶
- Parameters:
index (QModelIndex) –
- Return type:
Qt.ItemFlags
- index(self, row: int, column: int, parent: QModelIndex = QModelIndex()) QModelIndex ¶
- Parameters:
row (int) –
column (int) –
parent (QModelIndex = QModelIndex()) –
- Return type:
QModelIndex
- index2node(self, index: QModelIndex) QgsProcessingToolboxModelNode ¶
Returns the model node corresponding to the given
index
.See also
- Parameters:
index (QModelIndex) –
- Return type:
- indexForProvider(self, providerId: str) QModelIndex ¶
Returns the index corresponding to the specified
providerId
.See also
- Parameters:
providerId (str) –
- Return type:
QModelIndex
- indexOfParentTreeNode(self, parentNode: QgsProcessingToolboxModelNode) QModelIndex ¶
Returns the index corresponding to the parent of a given node.
- Parameters:
parentNode (QgsProcessingToolboxModelNode) –
- Return type:
QModelIndex
- isAlgorithm(self, index: QModelIndex) bool ¶
Returns
True
ifindex
corresponds to an algorithm.See also
- Parameters:
index (QModelIndex) –
- Return type:
bool
- isSignalConnected(self, QMetaMethod) bool ¶
- mimeData(self, indexes: Iterable[QModelIndex]) QMimeData ¶
- Parameters:
indexes (Iterable[QModelIndex]) –
- Return type:
QMimeData
- node2index(self, node: QgsProcessingToolboxModelNode) QModelIndex ¶
Returns the model index corresponding to the given
node
.See also
- Parameters:
node (QgsProcessingToolboxModelNode) –
- Return type:
QModelIndex
- parent(self, index: QModelIndex) QModelIndex ¶
- Parameters:
index (QModelIndex) –
- Return type:
QModelIndex
- persistentIndexList(self) List[QModelIndex] ¶
- providerForIndex(self, index: QModelIndex) QgsProcessingProvider ¶
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:
- providerIdForIndex(self, index: QModelIndex) str ¶
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
- receivers(self, PYQT_SIGNAL) int ¶
- recentAlgorithmAdded¶
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.
- Parameters:
name (str = ...) –
revision (int = ...) –
arguments (Sequence = ...) –
- Return type:
PYQT_SIGNAL
- resetInternalData(self)¶
- rowCount(self, parent: QModelIndex = QModelIndex()) int ¶
- Parameters:
parent (QModelIndex = QModelIndex()) –
- Return type:
int
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- timerEvent(self, QTimerEvent)¶