QGIS API Documentation 3.41.0-Master (cea29feecf2)
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:
53 explicit QgsProcessingRasterCalculatorExpressionLineEdit( QWidget *parent SIP_TRANSFERTHIS = nullptr );
54 ~QgsProcessingRasterCalculatorExpressionLineEdit() override;
55
59 void setLayers( const QVariantList &layers );
60
65 QString expression() const;
66
67 signals:
68
73 void expressionChanged( const QString &expression );
74
75 public slots:
76
82 void setExpression( const QString &expression );
83
84 private slots:
85
86 void expressionEdited( const QString &expression );
87 void expressionEdited();
88
90 void editExpression();
91
92 private:
93 QgsFilterLineEdit *mLineEdit = nullptr;
94 QToolButton *mButton = nullptr;
95 QVariantList mLayers;
96};
97
104class GUI_EXPORT QgsProcessingRasterCalculatorExpressionDialog : public QDialog, private Ui::QgsProcessingRasterCalculatorExpressionDialogBase
105{
106 Q_OBJECT
107
108 public:
112 QgsProcessingRasterCalculatorExpressionDialog( const QVariantList &layers, const QString &startExpression = QString(), QWidget *parent = nullptr );
113
119 void setExpression( const QString &text );
120
125 QString expression();
126
127 private slots:
128 void mLayersList_itemDoubleClicked( QListWidgetItem *item );
129
130 //calculator buttons
131 void mBtnPlus_clicked();
132 void mBtnMinus_clicked();
133 void mBtnMultiply_clicked();
134 void mBtnDivide_clicked();
135 void mBtnPower_clicked();
136 void mBtnSqrt_clicked();
137 void mBtnOpenBracket_clicked();
138 void mBtnCloseBracket_clicked();
139 void mBtnGreater_clicked();
140 void mBtnGreaterEqual_clicked();
141 void mBtnLess_clicked();
142 void mBtnLessEqual_clicked();
143 void mBtnEqual_clicked();
144 void mBtnNotEqual_clicked();
145 void mBtnAnd_clicked();
146 void mBtnOr_clicked();
147 void mBtnIf_clicked();
148 void mBtnMin_clicked();
149 void mBtnMax_clicked();
150 void mBtnAbs_clicked();
151 void mBtnSin_clicked();
152 void mBtnCos_clicked();
153 void mBtnTan_clicked();
154 void mBtnLog_clicked();
155 void mBtnAsin_clicked();
156 void mBtnAcos_clicked();
157 void mBtnAtan_clicked();
158 void mBtnLn_clicked();
159
160 private:
162 void populateLayers();
163
164 static QString quoteBandEntry( const QString &layerName );
165
166 QVariantList mLayers;
167 const QString mInitialText;
168};
169
171#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:76
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53