35 mButtonSelect->addAction( mActionSelect );
36 mButtonSelect->addAction( mActionAddToSelection );
37 mButtonSelect->addAction( mActionRemoveFromSelection );
38 mButtonSelect->addAction( mActionSelectIntersect );
39 mButtonSelect->setDefaultAction( mActionSelect );
41 mExpressionBuilder->setLayer( layer );
42 mExpressionBuilder->setExpressionText( startText );
43 mExpressionBuilder->loadFieldNames();
44 mExpressionBuilder->loadRecent(
"Selection" );
50 mExpressionBuilder->setExpressionContext( context );
58 return mExpressionBuilder;
63 mExpressionBuilder->setExpressionText( text );
68 return mExpressionBuilder->expressionText();
74 mExpressionBuilder->setGeomCalculator( da );
124 void QgsExpressionSelectionDialog::saveRecent()
126 mExpressionBuilder->saveToRecent(
"Selection" );
QByteArray toByteArray() const
virtual void closeEvent(QCloseEvent *e)
Modify current selection to include only select features which match.
QString expressionText()
Returns the current expression text.
static QIcon getThemeIcon(const QString &theName)
Helper to get a theme icon.
void on_mActionSelectIntersect_triggered()
QgsExpressionSelectionDialog(QgsVectorLayer *layer, const QString &startText=QString(), QWidget *parent=nullptr)
Creates a new selection dialog.
Set selection, removing any existing selection.
void selectByExpression(const QString &expression, SelectBehaviour behaviour=SetSelection)
Select matching features using an expression.
void on_mActionRemoveFromSelection_triggered()
void setValue(const QString &key, const QVariant &value)
void on_mActionAddToSelection_triggered()
static QgsExpressionContextScope * globalScope()
Creates a new scope which contains variables and functions relating to the global QGIS context...
void setGeomCalculator(const QgsDistanceArea &da)
Sets geometry calculator used in distance/area calculations.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
virtual void closeEvent(QCloseEvent *closeEvent) override
Implementation for closeEvent Saves the window geometry.
virtual void done(int r) override
Implementation for done (default behavior when pressing esc) Calls close, so the window geometry gets...
QgsExpressionBuilderWidget * expressionBuilder()
The builder widget that is used by the dialog.
void setExpressionText(const QString &text)
Sets the current expression text.
void on_mPbnClose_clicked()
General purpose distance and area calculator.
Add selection to current selection.
QVariant value(const QString &key, const QVariant &defaultValue) const
void on_mActionSelect_triggered()
Remove from current selection.
QString name
Read property of QString layerName.
static QgsExpressionContextScope * projectScope()
Creates a new scope which contains variables and functions relating to the current QGIS project...
static QgsExpressionContextScope * layerScope(const QgsMapLayer *layer)
Creates a new scope which contains variables and functions relating to a QgsMapLayer.
Represents a vector layer which manages a vector based data sets.