QGIS API Documentation  3.6.0-Noosa (5873452)
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 
86  void setFilters( QgsProcessingToolboxProxyModel::Filters filters );
87 
88 
92  void setInPlaceLayer( QgsVectorLayer *layer );
93 
94  public slots:
95 
100  void setFilterString( const QString &filter );
101 
102  private:
103 
104  QgsProcessingToolboxProxyModel *mModel = nullptr;
105  QgsProcessingToolboxModel *mToolboxModel = nullptr;
106 
110  QModelIndex findFirstVisibleAlgorithm( const QModelIndex &parent );
111 
112  friend class TestQgsProcessingModel;
113 
114 };
115 
117 #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.