33 mExpressions.removeAt( index );
38 mExpressions[
index].expression = exp;
68 if ( !expressionFieldsElem.
isNull() )
72 for (
int i = 0; i < fields.
size(); ++i )
80 QVariant::Type type = ( QVariant::Type )( field.
attribute(
"type" ).
toInt() );
const QString & name() const
Gets the name of the field.
QDomNodeList elementsByTagName(const QString &tagname) const
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
int precision() const
Gets the precision of the field.
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
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.
const QString & typeName() const
Gets the field type.
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.
const QString & comment() const
Returns the field comment.
QDomElement createElement(const QString &tagName)
QgsExpressionFieldBuffer()
QDomNode at(int index) const
QVariant::Type type() const
Gets variant type of the field as it will be retrieved from data source.