QGIS API Documentation  3.4.15-Madeira (e83d02e274)
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  private:
110 
111  QgsProcessingToolboxProxyModel *mModel = nullptr;
112  QgsProcessingToolboxModel *mToolboxModel = nullptr;
113 
117  QModelIndex findFirstVisibleAlgorithm( const QModelIndex &parent );
118 
119  friend class TestQgsProcessingModel;
120 
121 };
122 
124 #endif // QGSPROCESSINGTOOLBOXTREEVIEW_H
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:46
Abstract base class for processing algorithms.
#define SIP_TRANSFER
Definition: qgis_sip.h:36
A model for providers and algorithms shown within the Processing toolbox.
Registry for various processing components, including providers, algorithms and various parameters an...
A sort/filter proxy model for providers and algorithms shown within the Processing toolbox...
Represents a vector layer which manages a vector based data sets.