QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
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:
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 bool mWasCanceled = false;
68
69 void populateTable( const QVariantList &contents );
70
71 friend class TestProcessingGui;
72};
73
74
81class GUI_EXPORT QgsProcessingMatrixParameterPanel : public QWidget
82{
83 Q_OBJECT
84
85 public:
86
87 QgsProcessingMatrixParameterPanel( QWidget *parent = nullptr, const QgsProcessingParameterMatrix *param = nullptr );
88
89 QVariantList value() const { return mTable; }
90
91 void setValue( const QVariantList &value );
92
93 signals:
94
95 void changed();
96
97 private slots:
98
99 void showDialog();
100
101 private:
102
103 void updateSummaryText();
104
105 const QgsProcessingParameterMatrix *mParam = nullptr;
106 QLineEdit *mLineEdit = nullptr;
107 QToolButton *mToolButton = nullptr;
108
109 QVariantList mTable;
110
111 friend class TestProcessingGui;
112};
113
115
116#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