QGIS API Documentation 3.41.0-Master (cea29feecf2)
Loading...
Searching...
No Matches
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
26class QStandardItemModel;
27class QToolButton;
28
30
37class GUI_EXPORT QgsProcessingMatrixParameterPanelWidget : public QgsPanelWidget, private Ui::QgsProcessingMatrixParameterDialogBase
38{
39 Q_OBJECT
40
41 public:
45 QgsProcessingMatrixParameterPanelWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr, const QgsProcessingParameterMatrix *param = nullptr, const QVariantList &initialTable = QVariantList() );
46
50 QVariantList table() const;
51
52 private slots:
53
54 void addRow();
55 void deleteRow();
56 void deleteAllRows();
57
58 private:
59 QPushButton *mButtonAdd = nullptr;
60 QPushButton *mButtonRemove = nullptr;
61 QPushButton *mButtonRemoveAll = nullptr;
62 const QgsProcessingParameterMatrix *mParam = nullptr;
63 QStandardItemModel *mModel = nullptr;
64 bool mWasCanceled = false;
65
66 void populateTable( const QVariantList &contents );
67
68 friend class TestProcessingGui;
69};
70
71
78class GUI_EXPORT QgsProcessingMatrixParameterPanel : public QWidget
79{
80 Q_OBJECT
81
82 public:
83 QgsProcessingMatrixParameterPanel( QWidget *parent = nullptr, const QgsProcessingParameterMatrix *param = nullptr );
84
85 QVariantList value() const { return mTable; }
86
87 void setValue( const QVariantList &value );
88
89 signals:
90
91 void changed();
92
93 private slots:
94
95 void showDialog();
96
97 private:
98 void updateSummaryText();
99
100 const QgsProcessingParameterMatrix *mParam = nullptr;
101 QLineEdit *mLineEdit = nullptr;
102 QToolButton *mToolButton = nullptr;
103
104 QVariantList mTable;
105
106 friend class TestProcessingGui;
107};
108
110
111#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