QGIS API Documentation 3.41.0-Master (cea29feecf2)
Loading...
Searching...
No Matches
qgsexpressionbuilderdialog.h
Go to the documentation of this file.
1/***************************************************************************
2 qgisexpressionbuilderdialog.h - A generic expression builder dialog.
3 --------------------------------------
4 Date : 29-May-2011
5 Copyright : (C) 2011 by Nathan Woodrow
6 Email : woodrow.nathan 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 QGSEXPRESSIONBUILDERDIALOG_H
17#define QGSEXPRESSIONBUILDERDIALOG_H
18
19#include <QDialog>
20#include "ui_qgsexpressionbuilderdialogbase.h"
21#include "qgshelp.h"
22#include "qgis_gui.h"
23
24
29class GUI_EXPORT QgsExpressionBuilderDialog : public QDialog, private Ui::QgsExpressionBuilderDialogBase
30{
31 Q_OBJECT
32
33 Q_PROPERTY( bool allowEvalErrors READ allowEvalErrors WRITE setAllowEvalErrors NOTIFY allowEvalErrorsChanged )
34
35 public:
36 QgsExpressionBuilderDialog( QgsVectorLayer *layer, const QString &startText = QString(), QWidget *parent SIP_TRANSFERTHIS = nullptr, const QString &key = "generic", const QgsExpressionContext &context = QgsExpressionContext() );
37
39 QgsExpressionBuilderWidget *expressionBuilder();
40
41 void setExpressionText( const QString &text );
42
43 QString expressionText();
44
51 QString expectedOutputFormat();
52
58 void setExpectedOutputFormat( const QString &expected );
59
65 QgsExpressionContext expressionContext() const;
66
73 void setExpressionContext( const QgsExpressionContext &context );
74
76 void setGeomCalculator( const QgsDistanceArea &da );
77
83 bool allowEvalErrors() const;
84
90 void setAllowEvalErrors( bool allowEvalErrors );
91
92 signals:
93
100
101 protected:
108 void done( int r ) override;
109
110 void accept() override;
111 void reject() override;
112
113 private:
114 const QString mInitialText;
115 QString mRecentKey;
116 bool mAllowEvalErrors = false;
117
118 private slots:
119 void showHelp();
120 void syncOkButtonEnabledState();
121};
122
123// clazy:excludeall=qstring-allocations
124
125#endif
A general purpose distance and area calculator, capable of performing ellipsoid based calculations.
A generic dialog for building expression strings.
void allowEvalErrorsChanged()
Allow accepting expressions with evaluation errors.
A reusable widget that can be used to build a expression string.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Represents a vector layer which manages a vector based data sets.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53