25 QPushButton* okButton = buttonBox->button( QDialogButtonBox::Ok );
26 connect( builder, SIGNAL( expressionParsed(
bool ) ), okButton, SLOT(
setEnabled(
bool ) ) );
28 builder->setExpressionContext( context );
29 builder->setLayer( layer );
30 builder->setExpressionText( startText );
31 builder->loadFieldNames();
32 builder->loadRecent( mRecentKey );
45 builder->setExpressionText( text );
50 return builder->expressionText();
55 return builder->expressionContext();
60 builder->setExpressionContext( context );
73 builder->saveToRecent( mRecentKey );
80 builder->setGeomCalculator( da );
QByteArray toByteArray() const
void setExpressionText(const QString &text)
QgsExpressionBuilderWidget * expressionBuilder()
The builder widget that is used by the dialog.
QgsExpressionContext expressionContext() const
Returns the expression context for the dialog.
void setValue(const QString &key, const QVariant &value)
QgsExpressionBuilderDialog(QgsVectorLayer *layer, const QString &startText=QString(), QWidget *parent=nullptr, const QString &key="generic", const QgsExpressionContext &context=QgsExpressionContext())
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
void setExpressionContext(const QgsExpressionContext &context)
Sets the expression context for the dialog.
void setGeomCalculator(const QgsDistanceArea &da)
Sets geometry calculator used in distance/area calculations.
General purpose distance and area calculator.
QVariant value(const QString &key, const QVariant &defaultValue) const
virtual void done(int r) override
Is called when the dialog get accepted or rejected Used to save geometry.
virtual void accept() override
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
Represents a vector layer which manages a vector based data sets.