33 mExpressions.removeAt( index );
38 mExpressions[
index].expression = exp;
69 if ( !expressionFieldsElem.
isNull() )
73 for (
int i = 0; i < fields.
size(); ++i )
81 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
QString comment() const
Returns the field comment.
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)...
int precision() const
Gets the precision of the field.
QString name() const
Gets the name of the field.
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.
int length() const
Gets the length of the field.
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