QGIS API Documentation 3.28.0-Firenze (ed3ad0430f)
Public Types | Public Member Functions | List of all members
QgsProcessingToolboxProxyModel Class Reference

A sort/filter proxy model for providers and algorithms shown within the Processing toolbox, which automatically sorts the toolbox in a logical fashion and supports filtering the results. More...

#include <qgsprocessingtoolboxmodel.h>

Inheritance diagram for QgsProcessingToolboxProxyModel:
Inheritance graph
[legend]

Public Types

enum  Filter { FilterToolbox = 1 << 1 , FilterModeler = 1 << 2 , FilterInPlace = 1 << 3 , FilterShowKnownIssues = 1 << 4 }
 Available filter flags for filtering the model. More...
 

Public Member Functions

 QgsProcessingToolboxProxyModel (QObject *parent=nullptr, QgsProcessingRegistry *registry=nullptr, QgsProcessingRecentAlgorithmLog *recentLog=nullptr)
 Constructor for QgsProcessingToolboxProxyModel, with the given parent object. More...
 
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const override
 
bool filterAcceptsRow (int sourceRow, const QModelIndex &sourceParent) const override
 
Filters filters () const
 Returns any filters that affect how toolbox content is filtered. More...
 
QString filterString () const
 Returns the current filter string, if set. More...
 
bool lessThan (const QModelIndex &left, const QModelIndex &right) const override
 
void setFilters (QgsProcessingToolboxProxyModel::Filters filters)
 Set filters that affect how toolbox content is filtered. More...
 
void setFilterString (const QString &filter)
 Sets a filter string, such that only algorithms matching the specified string will be shown. More...
 
void setInPlaceLayer (QgsVectorLayer *layer)
 Sets the vector layer for in-place algorithm filter. More...
 
QgsProcessingToolboxModeltoolboxModel ()
 Returns the underlying source Processing toolbox model. More...
 
const QgsProcessingToolboxModeltoolboxModel () const
 Returns the underlying source Processing toolbox model. More...
 

Detailed Description

A sort/filter proxy model for providers and algorithms shown within the Processing toolbox, which automatically sorts the toolbox in a logical fashion and supports filtering the results.

Since
QGIS 3.4

Definition at line 417 of file qgsprocessingtoolboxmodel.h.

Member Enumeration Documentation

◆ Filter

Available filter flags for filtering the model.

Enumerator
FilterToolbox 

Filters out any algorithms and content which should not be shown in the toolbox.

FilterModeler 

Filters out any algorithms and content which should not be shown in the modeler.

FilterInPlace 

Only show algorithms which support in-place edits.

FilterShowKnownIssues 

Show algorithms with known issues (hidden by default)

Definition at line 424 of file qgsprocessingtoolboxmodel.h.

Constructor & Destructor Documentation

◆ QgsProcessingToolboxProxyModel()

QgsProcessingToolboxProxyModel::QgsProcessingToolboxProxyModel ( QObject *  parent = nullptr,
QgsProcessingRegistry registry = nullptr,
QgsProcessingRecentAlgorithmLog *  recentLog = nullptr 
)
explicit

Constructor for QgsProcessingToolboxProxyModel, 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.

Definition at line 672 of file qgsprocessingtoolboxmodel.cpp.

Member Function Documentation

◆ data()

QVariant QgsProcessingToolboxProxyModel::data ( const QModelIndex &  index,
int  role = Qt::DisplayRole 
) const
override

Definition at line 851 of file qgsprocessingtoolboxmodel.cpp.

◆ filterAcceptsRow()

bool QgsProcessingToolboxProxyModel::filterAcceptsRow ( int  sourceRow,
const QModelIndex &  sourceParent 
) const
override

Definition at line 715 of file qgsprocessingtoolboxmodel.cpp.

◆ filters()

Filters QgsProcessingToolboxProxyModel::filters ( ) const
inline

Returns any filters that affect how toolbox content is filtered.

See also
setFilters()

Definition at line 470 of file qgsprocessingtoolboxmodel.h.

◆ filterString()

QString QgsProcessingToolboxProxyModel::filterString ( ) const
inline

Returns the current filter string, if set.

See also
setFilterString()

Definition at line 493 of file qgsprocessingtoolboxmodel.h.

◆ lessThan()

bool QgsProcessingToolboxProxyModel::lessThan ( const QModelIndex &  left,
const QModelIndex &  right 
) const
override

Definition at line 806 of file qgsprocessingtoolboxmodel.cpp.

◆ setFilters()

void QgsProcessingToolboxProxyModel::setFilters ( QgsProcessingToolboxProxyModel::Filters  filters)

Set filters that affect how toolbox content is filtered.

See also
filters()

Definition at line 696 of file qgsprocessingtoolboxmodel.cpp.

◆ setFilterString()

void QgsProcessingToolboxProxyModel::setFilterString ( const QString &  filter)

Sets a filter string, such that only algorithms matching the specified string will be shown.

Matches are performed using a variety of tests, including checking against the algorithm name, short description, tags, etc.

See also
filterString()

Definition at line 709 of file qgsprocessingtoolboxmodel.cpp.

◆ setInPlaceLayer()

void QgsProcessingToolboxProxyModel::setInPlaceLayer ( QgsVectorLayer layer)

Sets the vector layer for in-place algorithm filter.

Definition at line 702 of file qgsprocessingtoolboxmodel.cpp.

◆ toolboxModel() [1/2]

QgsProcessingToolboxModel * QgsProcessingToolboxProxyModel::toolboxModel ( )

Returns the underlying source Processing toolbox model.

Definition at line 686 of file qgsprocessingtoolboxmodel.cpp.

◆ toolboxModel() [2/2]

const QgsProcessingToolboxModel * QgsProcessingToolboxProxyModel::toolboxModel ( ) const

Returns the underlying source Processing toolbox model.

Note
Not available in Python bindings

Definition at line 691 of file qgsprocessingtoolboxmodel.cpp.


The documentation for this class was generated from the following files: