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
84 sipCpp->setCustomPreviewGenerator( *a0, *a1, [a2](
const QVariant &value ) ->
QgsExpressionContext {
87 PyObject *s = sipCallMethod( NULL, a2,
"D", &value, sipType_QVariant, NULL );
91 if ( sipIsError == 0 )
95 sipReleaseType( t1, sipType_QgsExpressionContext, state );
105 void setExpressionText(
const QString &expression );
128 bool evalError()
const;
134 bool parserError()
const;
140 QList<QgsExpression::ParserError>
parserErrors()
const {
return mExpression.parserErrors(); }
147 QString currentPreviewText()
const;
176 void setCurrentFeature(
const QgsFeature &feature );
180 void linkActivated(
const QString & );
181 void setEvalError(
bool evalError );
182 void setParserError(
bool parserError );
183 void copyFullExpressionValue();
184 void setCustomChoice(
int );
187 void setExpressionToolTip(
const QString &toolTip );
188 void refreshPreview();
193 bool mUseGeomCalculator =
false;
195 bool mEvalError =
true;
196 bool mParserError =
true;
197 QString mExpressionText;
199 QAction *mCopyPreviewAction =
nullptr;
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...