66 void setCustomPreviewGenerator(
const QString &label,
const QList<QPair<QString, QVariant>> &choices,
const std::function<
QgsExpressionContext(
const QVariant & )> &previewContextGenerator );
82 void setCustomPreviewGenerator(
const QString &label,
const QList<QPair<QString, QVariant>> &choices, SIP_PYCALLABLE );
85 Py_BEGIN_ALLOW_THREADS
86 sipCpp->setCustomPreviewGenerator( *a0, *a1, [a2](
const QVariant &value ) ->
QgsExpressionContext {
89 PyObject *s = sipCallMethod( NULL, a2,
"D", &value, sipType_QVariant, NULL );
93 if ( sipIsError == 0 )
97 sipReleaseType( t1, sipType_QgsExpressionContext, state );
107 void setExpressionText(
const QString &expression );
130 bool evalError()
const;
136 bool parserError()
const;
142 QList<QgsExpression::ParserError>
parserErrors()
const {
return mExpression.parserErrors(); }
149 QString currentPreviewText()
const;
178 void setCurrentFeature(
const QgsFeature &feature );
182 void linkActivated(
const QString & );
183 void setEvalError(
bool evalError );
184 void setParserError(
bool parserError );
185 void copyFullExpressionValue();
186 void setCustomChoice(
int );
189 void setExpressionToolTip(
const QString &toolTip );
190 void refreshPreview();
195 bool mUseGeomCalculator =
false;
197 bool mEvalError =
true;
198 bool mParserError =
true;
199 QString mExpressionText;
201 QAction *mCopyPreviewAction =
nullptr;
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...