QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
gui
qgsexpressionlineedit.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsexpressionlineedit.h
3
----------------------
4
Date : 18.08.2016
5
Copyright : (C) 2016 Nyall Dawson
6
Email : nyall dot dawson 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 QGSEXPRESSIONLINEEDIT_H
17
#define QGSEXPRESSIONLINEEDIT_H
18
19
#include <memory>
20
21
#include "qgis_gui.h"
22
#include "
qgis_sip.h
"
23
#include "
qgsexpressioncontext.h
"
24
25
#include <QWidget>
26
27
class
QgsFilterLineEdit
;
28
class
QToolButton;
29
class
QgsDistanceArea
;
30
class
QgsExpressionContextGenerator
;
31
class
QgsCodeEditorExpression
;
32
49
class
GUI_EXPORT
QgsExpressionLineEdit
:
public
QWidget
50
{
51
Q_OBJECT
52
53
public
:
58
explicit
QgsExpressionLineEdit
( QWidget *parent
SIP_TRANSFERTHIS
=
nullptr
);
59
~QgsExpressionLineEdit
()
override
;
60
66
void
setExpressionDialogTitle
(
const
QString &title );
67
72
QString
expressionDialogTitle
()
const
{
return
mExpressionDialogTitle; }
73
79
void
setMultiLine(
bool
multiLine );
80
88
QString expectedOutputFormat()
const
;
89
96
void
setExpectedOutputFormat(
const
QString &expected );
97
102
void
setGeomCalculator(
const
QgsDistanceArea
&distanceArea );
103
112
void
setLayer(
QgsVectorLayer
*layer );
113
118
QString expression()
const
;
119
125
bool
isValidExpression( QString *expressionError
SIP_OUT
=
nullptr
)
const
;
126
133
void
registerExpressionContextGenerator(
const
QgsExpressionContextGenerator
*generator );
134
135
signals:
136
141
void
expressionChanged
(
const
QString &
expression
);
142
143
public
slots:
144
150
void
setExpression
(
const
QString &
expression
);
151
152
protected
:
153
void
changeEvent
( QEvent *event )
override
;
154
155
private
slots:
156
158
void
expressionEdited(
const
QString &
expression
);
159
void
expressionEdited();
160
162
void
editExpression();
163
169
void
updateLineEditStyle(
const
QString &
expression
= QString() );
170
171
private
:
172
QgsFilterLineEdit
*mLineEdit =
nullptr
;
173
QgsCodeEditorExpression
*mCodeEditor =
nullptr
;
174
QToolButton *mButton =
nullptr
;
175
QString mExpressionDialogTitle;
176
std::unique_ptr<QgsDistanceArea> mDa;
177
QgsExpressionContext
mExpressionContext;
178
const
QgsExpressionContextGenerator
*mExpressionContextGenerator =
nullptr
;
179
QgsVectorLayer
*mLayer =
nullptr
;
180
QString mExpectedOutputFormat;
181
182
bool
isExpressionValid(
const
QString &expressionStr );
183
184
friend
class
TestQgsFieldExpressionWidget
;
185
};
186
187
#endif
// QGSEXPRESSIONLINEEDIT_H
QgsCodeEditorExpression
A QGIS expression editor based on QScintilla2.
Definition
qgscodeeditorexpression.h:38
QgsDistanceArea
A general purpose distance and area calculator, capable of performing ellipsoid based calculations.
Definition
qgsdistancearea.h:54
QgsExpressionContextGenerator
Abstract interface for generating an expression context.
Definition
qgsexpressioncontextgenerator.h:36
QgsExpressionContext
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Definition
qgsexpressioncontext.h:491
QgsExpressionLineEdit::expression
QString expression() const
Returns the current expression shown in the widget.
Definition
qgsexpressionlineedit.cpp:138
QgsExpressionLineEdit::TestQgsFieldExpressionWidget
friend class TestQgsFieldExpressionWidget
Definition
qgsexpressionlineedit.h:184
QgsExpressionLineEdit::expressionDialogTitle
QString expressionDialogTitle() const
Returns the title used for the expression dialog.
Definition
qgsexpressionlineedit.h:72
QgsExpressionLineEdit::changeEvent
void changeEvent(QEvent *event) override
Definition
qgsexpressionlineedit.cpp:200
QgsExpressionLineEdit::~QgsExpressionLineEdit
~QgsExpressionLineEdit() override
QgsExpressionLineEdit::expressionChanged
void expressionChanged(const QString &expression)
Emitted when the expression is changed.
QgsExpressionLineEdit::setExpressionDialogTitle
void setExpressionDialogTitle(const QString &title)
Sets the title used in the expression builder dialog.
Definition
qgsexpressionlineedit.cpp:57
QgsExpressionLineEdit::setExpression
void setExpression(const QString &expression)
Sets the current expression to show in the widget.
Definition
qgsexpressionlineedit.cpp:160
QgsExpressionLineEdit::QgsExpressionLineEdit
QgsExpressionLineEdit(QWidget *parent=nullptr)
Constructor for QgsExpressionLineEdit.
Definition
qgsexpressionlineedit.cpp:39
QgsFilterLineEdit
QLineEdit subclass with built in support for clearing the widget's value and handling custom null val...
Definition
qgsfilterlineedit.h:41
QgsVectorLayer
Represents a vector layer which manages a vector based dataset.
Definition
qgsvectorlayer.h:414
qgis_sip.h
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition
qgis_sip.h:52
SIP_OUT
#define SIP_OUT
Definition
qgis_sip.h:57
qgsexpressioncontext.h
Generated on
for QGIS API Documentation by
1.17.0