QGIS API Documentation 3.34.0-Prizren (ffbdd678812)
Loading...
Searching...
No Matches
qgsprocessingrastercalculatorexpressionlineedit.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsprocessingrastercalculatorexpressionlineedit.h
3 ---------------------
4 begin : July 2023
5 copyright : (C) 2023 by Alexander Bruy
6 email : alexander dot bruy at gmail dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef QGSPROCESSINGRASTERCALCULATOREXPRESSIONLINEEDIT_H
19#define QGSPROCESSINGRASTERCALCULATOREXPRESSIONLINEEDIT_H
20
21#define SIP_NO_FILE
22
23#include <QWidget>
24#include <QDialog>
25
26#include "qgis.h"
27#include "qgis_gui.h"
28#include "ui_qgsprocessingrastercalculatorexpressiondialogbase.h"
29
30
32class QToolButton;
33class QgsMapLayer;
34
36
44class GUI_EXPORT QgsProcessingRasterCalculatorExpressionLineEdit : public QWidget
45{
46 Q_OBJECT
47
48 public:
49
54 explicit QgsProcessingRasterCalculatorExpressionLineEdit( QWidget *parent SIP_TRANSFERTHIS = nullptr );
55 ~QgsProcessingRasterCalculatorExpressionLineEdit() override;
56
60 void setLayers( const QVariantList &layers );
61
66 QString expression() const;
67
68 signals:
69
74 void expressionChanged( const QString &expression );
75
76 public slots:
77
83 void setExpression( const QString &expression );
84
85 private slots:
86
87 void expressionEdited( const QString &expression );
88 void expressionEdited();
89
91 void editExpression();
92
93 private:
94 QgsFilterLineEdit *mLineEdit = nullptr;
95 QToolButton *mButton = nullptr;
96 QVariantList mLayers;
97};
98
105class GUI_EXPORT QgsProcessingRasterCalculatorExpressionDialog : public QDialog, private Ui::QgsProcessingRasterCalculatorExpressionDialogBase
106{
107 Q_OBJECT
108
109 public:
110
114 QgsProcessingRasterCalculatorExpressionDialog( const QVariantList &layers, const QString &startExpression = QString(), QWidget *parent = nullptr );
115
121 void setExpression( const QString &text );
122
127 QString expression();
128
129 private slots:
130 void mLayersList_itemDoubleClicked( QListWidgetItem *item );
131
132 //calculator buttons
133 void mBtnPlus_clicked();
134 void mBtnMinus_clicked();
135 void mBtnMultiply_clicked();
136 void mBtnDivide_clicked();
137 void mBtnPower_clicked();
138 void mBtnSqrt_clicked();
139 void mBtnOpenBracket_clicked();
140 void mBtnCloseBracket_clicked();
141 void mBtnGreater_clicked();
142 void mBtnGreaterEqual_clicked();
143 void mBtnLess_clicked();
144 void mBtnLessEqual_clicked();
145 void mBtnEqual_clicked();
146 void mBtnNotEqual_clicked();
147 void mBtnAnd_clicked();
148 void mBtnOr_clicked();
149 void mBtnIf_clicked();
150 void mBtnMin_clicked();
151 void mBtnMax_clicked();
152 void mBtnAbs_clicked();
153 void mBtnSin_clicked();
154 void mBtnCos_clicked();
155 void mBtnTan_clicked();
156 void mBtnLog_clicked();
157 void mBtnAsin_clicked();
158 void mBtnAcos_clicked();
159 void mBtnAtan_clicked();
160 void mBtnLn_clicked();
161
162 private:
164 void populateLayers();
165
166 static QString quoteBandEntry( const QString &layerName );
167
168 QVariantList mLayers;
169 const QString mInitialText;
170};
171
173#endif // QGSPROCESSINGRASTERCALCULATOREXPRESSIONLINEEDIT_H
QLineEdit subclass with built in support for clearing the widget's value and handling custom null val...
Base class for all map layer types.
Definition qgsmaplayer.h:74
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53