QGIS API Documentation  2.99.0-Master (8ec3eaf)
Public Member Functions | Protected Member Functions | List of all members
QgsExpressionBuilderDialog Class Reference

A generic dialog for building expression strings. More...

#include <qgsexpressionbuilderdialog.h>

Inheritance diagram for QgsExpressionBuilderDialog:
Inheritance graph
[legend]

Public Member Functions

 QgsExpressionBuilderDialog (QgsVectorLayer *layer, const QString &startText=QString(), QWidget *parent=nullptr, const QString &key="generic", const QgsExpressionContext &context=QgsExpressionContext())
 
QgsExpressionBuilderWidgetexpressionBuilder ()
 The builder widget that is used by the dialog. More...
 
QgsExpressionContext expressionContext () const
 Returns the expression context for the dialog. More...
 
QString expressionText ()
 
void setExpressionContext (const QgsExpressionContext &context)
 Sets the expression context for the dialog. More...
 
void setExpressionText (const QString &text)
 
void setGeomCalculator (const QgsDistanceArea &da)
 Sets geometry calculator used in distance/area calculations. More...
 

Protected Member Functions

virtual void accept () override
 
virtual void done (int r) override
 Is called when the dialog get accepted or rejected Used to save geometry. More...
 

Detailed Description

A generic dialog for building expression strings.

Remarks
This class also shows an example on how to use QgsExpressionBuilderWidget

Definition at line 26 of file qgsexpressionbuilderdialog.h.

Constructor & Destructor Documentation

§ QgsExpressionBuilderDialog()

QgsExpressionBuilderDialog::QgsExpressionBuilderDialog ( QgsVectorLayer layer,
const QString &  startText = QString(),
QWidget *  parent = nullptr,
const QString &  key = "generic",
const QgsExpressionContext context = QgsExpressionContext() 
)

Definition at line 19 of file qgsexpressionbuilderdialog.cpp.

Member Function Documentation

§ accept()

void QgsExpressionBuilderDialog::accept ( )
overrideprotectedvirtual

Definition at line 71 of file qgsexpressionbuilderdialog.cpp.

§ done()

void QgsExpressionBuilderDialog::done ( int  r)
overrideprotectedvirtual

Is called when the dialog get accepted or rejected Used to save geometry.

Parameters
rresult value (unused)

Definition at line 63 of file qgsexpressionbuilderdialog.cpp.

§ expressionBuilder()

QgsExpressionBuilderWidget * QgsExpressionBuilderDialog::expressionBuilder ( )

The builder widget that is used by the dialog.

Definition at line 38 of file qgsexpressionbuilderdialog.cpp.

§ expressionContext()

QgsExpressionContext QgsExpressionBuilderDialog::expressionContext ( ) const

Returns the expression context for the dialog.

The context is used for the expression preview result and for populating the list of available functions and variables.

See also
setExpressionContext
Note
added in QGIS 2.12

Definition at line 53 of file qgsexpressionbuilderdialog.cpp.

§ expressionText()

QString QgsExpressionBuilderDialog::expressionText ( )

Definition at line 48 of file qgsexpressionbuilderdialog.cpp.

§ setExpressionContext()

void QgsExpressionBuilderDialog::setExpressionContext ( const QgsExpressionContext context)

Sets the expression context for the dialog.

The context is used for the expression preview result and for populating the list of available functions and variables.

Parameters
contextexpression context
See also
expressionContext
Note
added in QGIS 2.12

Definition at line 58 of file qgsexpressionbuilderdialog.cpp.

§ setExpressionText()

void QgsExpressionBuilderDialog::setExpressionText ( const QString &  text)

Definition at line 43 of file qgsexpressionbuilderdialog.cpp.

§ setGeomCalculator()

void QgsExpressionBuilderDialog::setGeomCalculator ( const QgsDistanceArea da)

Sets geometry calculator used in distance/area calculations.

Definition at line 77 of file qgsexpressionbuilderdialog.cpp.


The documentation for this class was generated from the following files: