16#ifndef QGSEXPRESSIONPREVIEWWIDGET_H
17#define QGSEXPRESSIONPREVIEWWIDGET_H
21#include "ui_qgsexpressionpreviewbase.h"
64 void setCustomPreviewGenerator(
const QString &label,
const QList< QPair< QString, QVariant > > &choices,
const std::function<
QgsExpressionContext(
const QVariant & ) > &previewContextGenerator );
80 void setCustomPreviewGenerator(
const QString &label,
const QList< QPair< QString, QVariant > > &choices, SIP_PYCALLABLE );
83 Py_BEGIN_ALLOW_THREADS
88 PyObject *s = sipCallMethod( NULL, a2,
"D", &value, sipType_QVariant, NULL );
92 if ( sipIsError == 0 )
96 sipReleaseType( t1, sipType_QgsExpressionContext, state );
106 void setExpressionText(
const QString &expression );
129 bool evalError()
const;
135 bool parserError()
const;
141 QList<QgsExpression::ParserError>
parserErrors()
const {
return mExpression.parserErrors();}
148 QString currentPreviewText()
const;
177 void setCurrentFeature(
const QgsFeature &feature );
181 void linkActivated(
const QString & );
182 void setEvalError(
bool evalError );
183 void setParserError(
bool parserError );
184 void copyFullExpressionValue();
185 void setCustomChoice(
int );
188 void setExpressionToolTip(
const QString &toolTip );
189 void refreshPreview();
194 bool mUseGeomCalculator =
false;
196 bool mEvalError =
true;
197 bool mParserError =
true;
198 QString mExpressionText;
200 QAction *mCopyPreviewAction =
nullptr;
A general purpose distance and area calculator, capable of performing ellipsoid based calculations.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Abstract base class for all nodes that can appear in an expression.
Class for parsing and evaluation of expressions (formerly called "search strings").
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Represents a vector layer which manages a vector based data sets.