QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
qgsprocessingtoolboxtreeview.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsprocessingtoolboxtreeview.h
3  -----------------------------
4  begin : July 2018
5  copyright : (C) 2018 by Nyall Dawson
6  email : nyall dot dawson at gmail dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #ifndef QGSPROCESSINGTOOLBOXTREEVIEW_H
17 #define QGSPROCESSINGTOOLBOXTREEVIEW_H
18 
19 #include "qgis.h"
20 #include "qgis_gui.h"
21 #include <QTreeView>
23 
25 class QgsProcessingRecentAlgorithmLog;
27 
29 
36 class GUI_EXPORT QgsProcessingToolboxTreeView : public QTreeView
37 {
38  Q_OBJECT
39 
40  public:
41 
52  QgsProcessingToolboxTreeView( QWidget *parent SIP_TRANSFERTHIS = nullptr,
53  QgsProcessingRegistry *registry = nullptr,
54  QgsProcessingRecentAlgorithmLog *recentLog = nullptr );
55 
62  void setRegistry(
63  QgsProcessingRegistry *registry,
64  QgsProcessingRecentAlgorithmLog *recentLog = nullptr );
65 
69  void setToolboxProxyModel( QgsProcessingToolboxProxyModel *model SIP_TRANSFER );
70 
75  const QgsProcessingAlgorithm *algorithmForIndex( const QModelIndex &index );
76 
81  const QgsProcessingAlgorithm *selectedAlgorithm();
82 
87  void setFilters( QgsProcessingToolboxProxyModel::Filters filters );
88 
94  QgsProcessingToolboxProxyModel::Filters filters() const;
95 
99  void setInPlaceLayer( QgsVectorLayer *layer );
100 
101  public slots:
102 
107  void setFilterString( const QString &filter );
108 
109  protected:
110 
111  void keyPressEvent( QKeyEvent *event ) override;
112 
113  private:
114 
115  QgsProcessingToolboxProxyModel *mModel = nullptr;
116  QgsProcessingToolboxModel *mToolboxModel = nullptr;
117 
121  QModelIndex findFirstVisibleAlgorithm( const QModelIndex &parent );
122 
123  friend class TestQgsProcessingModel;
124 
125 };
126 
128 #endif // QGSPROCESSINGTOOLBOXTREEVIEW_H
qgsprocessingtoolboxmodel.h
qgis.h
QgsProcessingToolboxProxyModel
A sort/filter proxy model for providers and algorithms shown within the Processing toolbox,...
Definition: qgsprocessingtoolboxmodel.h:417
SIP_TRANSFER
#define SIP_TRANSFER
Definition: qgis_sip.h:36
QgsProcessingToolboxModel
A model for providers and algorithms shown within the Processing toolbox.
Definition: qgsprocessingtoolboxmodel.h:274
QgsProcessingAlgorithm
Abstract base class for processing algorithms.
Definition: qgsprocessingalgorithm.h:52
QgsVectorLayer
Represents a vector layer which manages a vector based data sets.
Definition: qgsvectorlayer.h:391
QgsProcessingRegistry
Registry for various processing components, including providers, algorithms and various parameters an...
Definition: qgsprocessingregistry.h:39
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53