33 mExpressions.removeAt( index );
38 mExpressions[
index].field.setName( name );
43 mExpressions[
index].expression = exp;
74 if ( !expressionFieldsElem.
isNull() )
78 for (
int i = 0; i < fields.
size(); ++i )
86 QVariant::Type type =
static_cast< QVariant::Type
>( field.
attribute(
"type" ).
toInt() );
Class for parsing and evaluation of expressions (formerly called "search strings").
QDomNodeList elementsByTagName(const QString &tagname) const
void renameExpression(int index, const QString &name)
Renames an expression field at a given index.
struct QgsExpressionFieldBuffer::ExpressionField ExpressionField
void addExpression(const QString &exp, const QgsField &fld)
Add an expression to the buffer.
QDomNode appendChild(const QDomNode &newChild)
QString attribute(const QString &name, const QString &defValue) const
Container of fields for a vector layer.
bool appendExpressionField(const QgsField &field, int originIndex)
Append an expression field. The field must have unique name, otherwise it is rejected (returns false)...
QDomElement toElement() const
QString typeName() const
Gets the field type.
void setAttribute(const QString &name, const QString &value)
int toInt(bool *ok, int base) const
void writeXml(QDomNode &layer_node, QDomDocument &document) const
Saves expressions to xml under the layer node.
Encapsulate a field in an attribute table or data source.
void updateFields(QgsFields &flds)
Adds fields with the expressions buffered in this object to a QgsFields object.
void updateExpression(int index, const QString &exp)
Changes the expression at a given index.
void readXml(const QDomNode &layer_node)
Reads expressions from project file.
QDomElement firstChildElement(const QString &tagName) const
void removeExpression(int index)
Remove an expression from the buffer.
QDomElement createElement(const QString &tagName)
QVariant::Type type() const
Gets variant type of the field as it will be retrieved from data source.
QgsExpressionFieldBuffer()
QDomNode at(int index) const