QGIS API Documentation  3.6.0-Noosa (5873452)
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
 Constructor for QgsExpressionFieldBuffer. More...
 
void addExpression (const QString &exp, const QgsField &fld)
 Add an expression to the buffer. More...
 
QList< QgsExpressionFieldBuffer::ExpressionFieldexpressions () const
 
void readXml (const QDomNode &layer_node)
 Reads expressions from project file. More...
 
void removeExpression (int index)
 Remove an expression from the buffer. More...
 
void renameExpression (int index, const QString &name)
 Renames an expression field at a given index. More...
 
void updateExpression (int index, const QString &exp)
 Changes the expression at a given index. More...
 
void updateFields (QgsFields &flds)
 Adds fields with the expressions buffered in this object to a QgsFields object. More...
 
void writeXml (QDomNode &layer_node, QDomDocument &document) const
 Saves expressions to xml under the layer node. More...
 

Detailed Description

Buffers information about expression fields for a vector layer.

Since
QGIS 2.6

Definition at line 35 of file qgsexpressionfieldbuffer.h.

Constructor & Destructor Documentation

◆ QgsExpressionFieldBuffer()

QgsExpressionFieldBuffer::QgsExpressionFieldBuffer ( )
default

Constructor for QgsExpressionFieldBuffer.

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 106 of file qgsexpressionfieldbuffer.h.

◆ readXml()

void QgsExpressionFieldBuffer::readXml ( const QDomNode &  layer_node)

Reads expressions from project file.

Definition at line 65 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
Since
QGIS 3.0

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
Since
QGIS 2.9

Definition at line 38 of file qgsexpressionfieldbuffer.cpp.

◆ updateFields()

void QgsExpressionFieldBuffer::updateFields ( QgsFields flds)

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

Parameters
fldsThe fields to be updated

Definition at line 92 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: