QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
|
A model for providers and algorithms shown within the Processing toolbox. More...
#include <qgsprocessingtoolboxmodel.h>
Public Types | |
enum class | CustomRole : int { NodeType = Qt::UserRole , AlgorithmFlags , AlgorithmId , AlgorithmName , AlgorithmShortDescription , AlgorithmTags , ProviderFlags } |
Custom model roles. More... | |
Signals | |
void | favoriteAlgorithmAdded () |
Emitted whenever favorite algorithms are added to the model. | |
void | recentAlgorithmAdded () |
Emitted whenever recent algorithms are added to the model. | |
Public Member Functions | |
QgsProcessingToolboxModel (QObject *parent=nullptr, QgsProcessingRegistry *registry=nullptr, QgsProcessingRecentAlgorithmLog *recentLog=nullptr, QgsProcessingFavoriteAlgorithmManager *favoriteManager=nullptr) | |
Constructor for QgsProcessingToolboxModel, with the given parent object. | |
const QgsProcessingAlgorithm * | algorithmForIndex (const QModelIndex &index) const |
Returns the algorithm which corresponds to a given index, or nullptr if the index does not represent an algorithm. | |
int | columnCount (const QModelIndex &=QModelIndex()) const override |
QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override |
Qt::ItemFlags | flags (const QModelIndex &index) const override |
QModelIndex | index (int row, int column, const QModelIndex &parent=QModelIndex()) const override |
QgsProcessingToolboxModelNode * | index2node (const QModelIndex &index) const |
Returns the model node corresponding to the given index. | |
QModelIndex | indexForProvider (const QString &providerId) const |
Returns the index corresponding to the specified providerId. | |
QModelIndex | indexOfParentTreeNode (QgsProcessingToolboxModelNode *parentNode) const |
Returns the index corresponding to the parent of a given node. | |
bool | isAlgorithm (const QModelIndex &index) const |
Returns true if index corresponds to an algorithm. | |
QMimeData * | mimeData (const QModelIndexList &indexes) const override |
QModelIndex | node2index (QgsProcessingToolboxModelNode *node) const |
Returns the model index corresponding to the given node. | |
QModelIndex | parent (const QModelIndex &index) const override |
QgsProcessingProvider * | providerForIndex (const QModelIndex &index) const |
Returns the provider which corresponds to a given index, or nullptr if the index does not represent a provider. | |
QString | providerIdForIndex (const QModelIndex &index) const |
Returns the provider ID which corresponds to a given index, or an empty string if the index does not represent a provider. | |
int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
A model for providers and algorithms shown within the Processing toolbox.
See QgsProcessingToolboxProxyModel for a sorted, filterable version of this model.
Definition at line 297 of file qgsprocessingtoolboxmodel.h.
|
strong |
Custom model roles.
Definition at line 311 of file qgsprocessingtoolboxmodel.h.
QgsProcessingToolboxModel::QgsProcessingToolboxModel | ( | QObject * | parent = nullptr , |
QgsProcessingRegistry * | registry = nullptr , |
||
QgsProcessingRecentAlgorithmLog * | recentLog = nullptr , |
||
QgsProcessingFavoriteAlgorithmManager * | favoriteManager = nullptr |
||
) |
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 to QgsApplication::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
Definition at line 119 of file qgsprocessingtoolboxmodel.cpp.
const QgsProcessingAlgorithm * QgsProcessingToolboxModel::algorithmForIndex | ( | const QModelIndex & | index | ) | const |
Returns the algorithm which corresponds to a given index, or nullptr
if the index does not represent an algorithm.
Definition at line 706 of file qgsprocessingtoolboxmodel.cpp.
|
override |
Definition at line 636 of file qgsprocessingtoolboxmodel.cpp.
|
override |
Definition at line 417 of file qgsprocessingtoolboxmodel.cpp.
|
signal |
Emitted whenever favorite algorithms are added to the model.
|
override |
Definition at line 409 of file qgsprocessingtoolboxmodel.cpp.
|
override |
Definition at line 641 of file qgsprocessingtoolboxmodel.cpp.
QgsProcessingToolboxModelNode * QgsProcessingToolboxModel::index2node | ( | const QModelIndex & | index | ) | const |
Returns the model node corresponding to the given index.
Definition at line 324 of file qgsprocessingtoolboxmodel.cpp.
QModelIndex QgsProcessingToolboxModel::indexForProvider | ( | const QString & | providerId | ) | const |
Returns the index corresponding to the specified providerId.
Definition at line 721 of file qgsprocessingtoolboxmodel.cpp.
QModelIndex QgsProcessingToolboxModel::indexOfParentTreeNode | ( | QgsProcessingToolboxModelNode * | parentNode | ) | const |
Returns the index corresponding to the parent of a given node.
Definition at line 742 of file qgsprocessingtoolboxmodel.cpp.
bool QgsProcessingToolboxModel::isAlgorithm | ( | const QModelIndex & | index | ) | const |
Returns true
if index corresponds to an algorithm.
Definition at line 715 of file qgsprocessingtoolboxmodel.cpp.
|
override |
Definition at line 669 of file qgsprocessingtoolboxmodel.cpp.
QModelIndex QgsProcessingToolboxModel::node2index | ( | QgsProcessingToolboxModelNode * | node | ) | const |
Returns the model index corresponding to the given node.
Definition at line 333 of file qgsprocessingtoolboxmodel.cpp.
|
override |
Definition at line 653 of file qgsprocessingtoolboxmodel.cpp.
QgsProcessingProvider * QgsProcessingToolboxModel::providerForIndex | ( | const QModelIndex & | index | ) | const |
Returns the provider which corresponds to a given index, or nullptr
if the index does not represent a provider.
Definition at line 688 of file qgsprocessingtoolboxmodel.cpp.
QString QgsProcessingToolboxModel::providerIdForIndex | ( | const QModelIndex & | index | ) | const |
Returns the provider ID which corresponds to a given index, or an empty string if the index does not represent a provider.
Definition at line 697 of file qgsprocessingtoolboxmodel.cpp.
|
signal |
Emitted whenever recent algorithms are added to the model.
|
override |
Definition at line 627 of file qgsprocessingtoolboxmodel.cpp.