QGIS API Documentation 3.41.0-Master (fda2aa46e9a)
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
QgsExpressionFieldBuffer Class Reference

Buffers information about expression fields for a vector layer. More...

#include <qgsexpressionfieldbuffer.h>

Classes

struct  ExpressionField
 

Public Member Functions

 QgsExpressionFieldBuffer ()=default
 
void addExpression (const QString &exp, const QgsField &fld)
 Add an expression to the buffer.
 
QList< QgsExpressionFieldBuffer::ExpressionFieldexpressions () const
 
void readXml (const QDomNode &layer_node)
 Reads expressions from project file.
 
void removeExpression (int index)
 Remove an expression from the buffer.
 
void renameExpression (int index, const QString &name)
 Renames an expression field at a given index.
 
void updateExpression (int index, const QString &exp)
 Changes the expression at a given index.
 
void updateFields (QgsFields &flds) const
 Adds fields with the expressions buffered in this object to a QgsFields object.
 
void writeXml (QDomNode &layer_node, QDomDocument &document) const
 Saves expressions to xml under the layer node.
 

Detailed Description

Buffers information about expression fields for a vector layer.

Definition at line 34 of file qgsexpressionfieldbuffer.h.

Constructor & Destructor Documentation

◆ QgsExpressionFieldBuffer()

QgsExpressionFieldBuffer::QgsExpressionFieldBuffer ( )
default

Member Function Documentation

◆ addExpression()

void QgsExpressionFieldBuffer::addExpression ( const QString &  exp,
const QgsField fld 
)

Add an expression to the buffer.

Parameters
expexpression to add
fldfield to add

Definition at line 23 of file qgsexpressionfieldbuffer.cpp.

◆ expressions()

QList< QgsExpressionFieldBuffer::ExpressionField > QgsExpressionFieldBuffer::expressions ( ) const
inline

Definition at line 100 of file qgsexpressionfieldbuffer.h.

◆ readXml()

void QgsExpressionFieldBuffer::readXml ( const QDomNode &  layer_node)

Reads expressions from project file.

Definition at line 66 of file qgsexpressionfieldbuffer.cpp.

◆ removeExpression()

void QgsExpressionFieldBuffer::removeExpression ( int  index)

Remove an expression from the buffer.

Parameters
indexindex of expression to remove

Definition at line 28 of file qgsexpressionfieldbuffer.cpp.

◆ renameExpression()

void QgsExpressionFieldBuffer::renameExpression ( int  index,
const QString &  name 
)

Renames an expression field at a given index.

Parameters
indexThe index of the expression to change
nameNew name for field

Definition at line 33 of file qgsexpressionfieldbuffer.cpp.

◆ updateExpression()

void QgsExpressionFieldBuffer::updateExpression ( int  index,
const QString &  exp 
)

Changes the expression at a given index.

Parameters
indexThe index of the expression to change
expThe new expression to set

Definition at line 38 of file qgsexpressionfieldbuffer.cpp.

◆ updateFields()

void QgsExpressionFieldBuffer::updateFields ( QgsFields flds) const

Adds fields with the expressions buffered in this object to a QgsFields object.

Parameters
fldsThe fields to be updated

Definition at line 93 of file qgsexpressionfieldbuffer.cpp.

◆ writeXml()

void QgsExpressionFieldBuffer::writeXml ( QDomNode &  layer_node,
QDomDocument &  document 
) const

Saves expressions to xml under the layer node.

Definition at line 43 of file qgsexpressionfieldbuffer.cpp.


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