QGIS API Documentation  3.6.0-Noosa (5873452)
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 QgsProcessingMatrixParameterDialog : public QDialog, private Ui::QgsProcessingMatrixParameterDialogBase
38 {
39  Q_OBJECT
40 
41  public:
42 
46  QgsProcessingMatrixParameterDialog( QWidget *parent SIP_TRANSFERTHIS = nullptr, Qt::WindowFlags flags = 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
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:46
A table (matrix) parameter for processing algorithms.