49 Q_PROPERTY( QString expressionDialogTitle READ expressionDialogTitle WRITE setExpressionDialogTitle )
51 Q_PROPERTY(
bool allowEmptyFieldName READ allowEmptyFieldName WRITE setAllowEmptyFieldName )
52 Q_PROPERTY(
bool allowEvalErrors READ allowEvalErrors WRITE setAllowEvalErrors NOTIFY allowEvalErrorsChanged )
62 void setExpressionDialogTitle( const QString &title );
74 const QString expressionDialogTitle() {
return mExpressionDialogTitle; }
77 void setFilters( QgsFieldProxyModel::Filters filters );
84 void setAllowEmptyFieldName(
bool allowEmpty );
91 bool allowEmptyFieldName()
const;
93 void setLeftHandButtonStyle(
bool isLeft );
96 QgsFieldProxyModel::Filters
filters()
const {
return mFieldProxyModel->filters(); }
106 QString currentField(
bool *isExpression =
nullptr,
bool *isValid =
nullptr )
const;
111 bool isValidExpression( QString *expressionError =
nullptr )
const;
116 bool isExpression()
const;
121 QString currentText()
const;
129 QString asExpression()
const;
140 QString expression()
const;
163 bool allowEvalErrors()
const;
171 void setAllowEvalErrors(
bool allowEvalErrors );
197 void setRow(
int row ) { mCombo->setCurrentIndex( row ); }
200 void setField(
const QString &fieldName );
206 void setFields(
const QgsFields &fields );
214 void setExpression(
const QString &expression );
218 void editExpression();
221 void expressionEdited(
const QString &expression );
224 void expressionEditingFinished();
226 void currentFieldChanged();
233 void updateLineEditStyle(
const QString &expression = QString() );
235 bool isExpressionValid(
const QString &expressionStr );
238 void changeEvent( QEvent *event )
override;
240 bool eventFilter( QObject *watched, QEvent *event )
override;
245 void beforeResetModel();
246 void afterResetModel();
249 QComboBox *mCombo =
nullptr;
250 QToolButton *mButton =
nullptr;
252 QString mExpressionDialogTitle;
253 std::shared_ptr<const QgsDistanceArea> mDistanceArea;
256 QString mBackupExpression;
257 bool mAllowEvalErrors =
false;
259 friend class TestQgsFieldExpressionWidget;
Abstract interface for generating an expression context.
Single scope for storing variables and functions for use within a QgsExpressionContext.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...