QGIS API Documentation
4.3.0-Master (52aa6503bed)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
gui
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 "ui_qgsexpressionbuilderdialogbase.h"
20
21
#include "qgis_gui.h"
22
#include "
qgshelp.h
"
23
24
#include <QDialog>
25
30
class
GUI_EXPORT
QgsExpressionBuilderDialog
:
public
QDialog,
private
Ui::QgsExpressionBuilderDialogBase
31
{
32
Q_OBJECT
33
34
Q_PROPERTY(
bool
allowEvalErrors
READ
allowEvalErrors
WRITE
setAllowEvalErrors
NOTIFY
allowEvalErrorsChanged
)
35
36
public
:
37
QgsExpressionBuilderDialog
(
38
QgsVectorLayer
*layer,
const
QString &startText = QString(), QWidget *parent
SIP_TRANSFERTHIS
=
nullptr
,
const
QString &key =
"generic"
,
const
QgsExpressionContext
&context =
QgsExpressionContext
()
39
);
40
42
QgsExpressionBuilderWidget
*
expressionBuilder
();
43
44
void
setExpressionText
(
const
QString &text );
45
46
QString
expressionText
();
47
54
QString
expectedOutputFormat
();
55
61
void
setExpectedOutputFormat
(
const
QString &expected );
62
68
QgsExpressionContext
expressionContext
()
const
;
69
76
void
setExpressionContext
(
const
QgsExpressionContext
&context );
77
79
void
setGeomCalculator
(
const
QgsDistanceArea
&da );
80
86
bool
allowEvalErrors
()
const
;
87
93
void
setAllowEvalErrors
(
bool
allowEvalErrors
);
94
95
signals:
96
102
void
allowEvalErrorsChanged
();
103
104
protected
:
111
void
done
(
int
r )
override
;
112
113
void
accept
()
override
;
114
void
reject
()
override
;
115
116
private
:
117
const
QString mInitialText;
118
QString mRecentKey;
119
bool
mAllowEvalErrors =
false
;
120
121
private
slots:
122
void
showHelp();
123
void
syncOkButtonEnabledState();
124
};
125
126
// clazy:excludeall=qstring-allocations
127
128
#endif
QgsDistanceArea
A general purpose distance and area calculator, capable of performing ellipsoid based calculations.
Definition
qgsdistancearea.h:54
QgsExpressionBuilderDialog::expressionText
QString expressionText()
Definition
qgsexpressionbuilderdialog.cpp:60
QgsExpressionBuilderDialog::done
void done(int r) override
Is called when the dialog get accepted or rejected Used to save geometry.
Definition
qgsexpressionbuilderdialog.cpp:85
QgsExpressionBuilderDialog::setGeomCalculator
void setGeomCalculator(const QgsDistanceArea &da)
Sets geometry calculator used in distance/area calculations.
Definition
qgsexpressionbuilderdialog.cpp:126
QgsExpressionBuilderDialog::QgsExpressionBuilderDialog
QgsExpressionBuilderDialog(QgsVectorLayer *layer, const QString &startText=QString(), QWidget *parent SIP_TRANSFERTHIS=nullptr, const QString &key="generic", const QgsExpressionContext &context=QgsExpressionContext())
Definition
qgsexpressionbuilderdialog.cpp:29
QgsExpressionBuilderDialog::setExpressionText
void setExpressionText(const QString &text)
Definition
qgsexpressionbuilderdialog.cpp:55
QgsExpressionBuilderDialog::setExpectedOutputFormat
void setExpectedOutputFormat(const QString &expected)
Set the expected format string, which is shown in the dialog.
Definition
qgsexpressionbuilderdialog.cpp:70
QgsExpressionBuilderDialog::expressionBuilder
QgsExpressionBuilderWidget * expressionBuilder()
The builder widget that is used by the dialog.
Definition
qgsexpressionbuilderdialog.cpp:50
QgsExpressionBuilderDialog::reject
void reject() override
Definition
qgsexpressionbuilderdialog.cpp:96
QgsExpressionBuilderDialog::allowEvalErrors
bool allowEvalErrors
Definition
qgsexpressionbuilderdialog.h:34
QgsExpressionBuilderDialog::accept
void accept() override
Definition
qgsexpressionbuilderdialog.cpp:90
QgsExpressionBuilderDialog::allowEvalErrorsChanged
void allowEvalErrorsChanged()
Allow accepting expressions with evaluation errors.
QgsExpressionBuilderDialog::setExpressionContext
void setExpressionContext(const QgsExpressionContext &context)
Sets the expression context for the dialog.
Definition
qgsexpressionbuilderdialog.cpp:80
QgsExpressionBuilderDialog::setAllowEvalErrors
void setAllowEvalErrors(bool allowEvalErrors)
Allow accepting expressions with evaluation errors.
Definition
qgsexpressionbuilderdialog.cpp:137
QgsExpressionBuilderDialog::expectedOutputFormat
QString expectedOutputFormat()
Returns the expected format string, which is shown in the dialog.
Definition
qgsexpressionbuilderdialog.cpp:65
QgsExpressionBuilderDialog::expressionContext
QgsExpressionContext expressionContext() const
Returns the expression context for the dialog.
Definition
qgsexpressionbuilderdialog.cpp:75
QgsExpressionBuilderWidget
A reusable widget that can be used to build an expression string.
Definition
qgsexpressionbuilderwidget.h:50
QgsExpressionContext
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Definition
qgsexpressioncontext.h:491
QgsVectorLayer
Represents a vector layer which manages a vector based dataset.
Definition
qgsvectorlayer.h:414
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition
qgis_sip.h:52
qgshelp.h
Generated on
for QGIS API Documentation by
1.17.0