QGIS API Documentation 3.41.0-Master (181b2f43d8e)
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:
37 const QString &startText = QString(),
38 QWidget *parent SIP_TRANSFERTHIS = nullptr,
39 const QString &key = "generic",
40 const QgsExpressionContext &context = QgsExpressionContext() );
41
43 QgsExpressionBuilderWidget *expressionBuilder();
44
45 void setExpressionText( const QString &text );
46
47 QString expressionText();
48
55 QString expectedOutputFormat();
56
62 void setExpectedOutputFormat( const QString &expected );
63
69 QgsExpressionContext expressionContext() const;
70
77 void setExpressionContext( const QgsExpressionContext &context );
78
80 void setGeomCalculator( const QgsDistanceArea &da );
81
87 bool allowEvalErrors() const;
88
94 void setAllowEvalErrors( bool allowEvalErrors );
95
96 signals:
97
104
105 protected:
106
113 void done( int r ) override;
114
115 void accept() override;
116 void reject() override;
117
118 private:
119 const QString mInitialText;
120 QString mRecentKey;
121 bool mAllowEvalErrors = false;
122
123 private slots:
124 void showHelp();
125 void syncOkButtonEnabledState();
126
127};
128
129// clazy:excludeall=qstring-allocations
130
131#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