QGIS API Documentation  3.20.0-Odense (decaadbb31)
qgsprocessingmatrixparameterdialog.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsprocessingmatrixparameterdialog.h
3  ----------------------------------
4  Date : February 2019
5  Copyright : (C) 2019 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 QGSPROCESSINGMATRIXPARAMETERDIALOG_H
17 #define QGSPROCESSINGMATRIXPARAMETERDIALOG_H
18 
19 #include "qgis.h"
20 #include "qgis_gui.h"
21 #include "ui_qgsprocessingmatrixparameterdialogbase.h"
23 
24 #define SIP_NO_FILE
25 
26 class QStandardItemModel;
27 class QToolButton;
28 
30 
37 class GUI_EXPORT QgsProcessingMatrixParameterPanelWidget : public QgsPanelWidget, private Ui::QgsProcessingMatrixParameterDialogBase
38 {
39  Q_OBJECT
40 
41  public:
42 
46  QgsProcessingMatrixParameterPanelWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr, const QgsProcessingParameterMatrix *param = nullptr,
47  const QVariantList &initialTable = QVariantList() );
48 
52  QVariantList table() const;
53 
54  private slots:
55 
56  void addRow();
57  void deleteRow();
58  void deleteAllRows();
59 
60  private:
61 
62  QPushButton *mButtonAdd = nullptr;
63  QPushButton *mButtonRemove = nullptr;
64  QPushButton *mButtonRemoveAll = nullptr;
65  const QgsProcessingParameterMatrix *mParam = nullptr;
66  QStandardItemModel *mModel = nullptr;
67 
68  void populateTable( const QVariantList &contents );
69 
70  friend class TestProcessingGui;
71 };
72 
73 
80 class GUI_EXPORT QgsProcessingMatrixParameterPanel : public QWidget
81 {
82  Q_OBJECT
83 
84  public:
85 
86  QgsProcessingMatrixParameterPanel( QWidget *parent = nullptr, const QgsProcessingParameterMatrix *param = nullptr );
87 
88  QVariantList value() const { return mTable; }
89 
90  void setValue( const QVariantList &value );
91 
92  signals:
93 
94  void changed();
95 
96  private slots:
97 
98  void showDialog();
99 
100  private:
101 
102  void updateSummaryText();
103 
104  const QgsProcessingParameterMatrix *mParam = nullptr;
105  QLineEdit *mLineEdit = nullptr;
106  QToolButton *mToolButton = nullptr;
107 
108  QVariantList mTable;
109 
110  friend class TestProcessingGui;
111 };
112 
114 
115 #endif // QGSPROCESSINGMATRIXPARAMETERDIALOG_H
Base class for any widget that can be shown as a inline panel.
A table (matrix) parameter for processing algorithms.
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53