30 mExpressions.removeAt( index );
35 mExpressions[index].field.setName( name );
45 QDomElement expressionFieldsElem = document.createElement( QStringLiteral(
"expressionfields" ) );
46 layerNode.appendChild( expressionFieldsElem );
48 const auto constMExpressions = mExpressions;
51 QDomElement fldElem = document.createElement( QStringLiteral(
"field" ) );
53 fldElem.setAttribute( QStringLiteral(
"expression" ), fld.cachedExpression.expression() );
54 fldElem.setAttribute( QStringLiteral(
"name" ), fld.field.name() );
55 fldElem.setAttribute( QStringLiteral(
"precision" ), fld.field.precision() );
56 fldElem.setAttribute( QStringLiteral(
"comment" ), fld.field.comment() );
57 fldElem.setAttribute( QStringLiteral(
"length" ), fld.field.length() );
58 fldElem.setAttribute( QStringLiteral(
"type" ), fld.field.type() );
59 fldElem.setAttribute( QStringLiteral(
"subType" ), fld.field.subType() );
60 fldElem.setAttribute( QStringLiteral(
"typeName" ), fld.field.typeName() );
62 expressionFieldsElem.appendChild( fldElem );
70 const QDomElement expressionFieldsElem = layerNode.firstChildElement( QStringLiteral(
"expressionfields" ) );
72 if ( !expressionFieldsElem.isNull() )
74 QDomNodeList fields = expressionFieldsElem.elementsByTagName( QStringLiteral(
"field" ) );
76 for (
int i = 0; i < fields.size(); ++i )
78 QDomElement field = fields.at( i ).toElement();
79 QString exp = field.attribute( QStringLiteral(
"expression" ) );
80 QString name = field.attribute( QStringLiteral(
"name" ) );
81 QString comment = field.attribute( QStringLiteral(
"comment" ) );
82 int precision = field.attribute( QStringLiteral(
"precision" ) ).toInt();
83 int length = field.attribute( QStringLiteral(
"length" ) ).toInt();
84 QVariant::Type type =
static_cast< QVariant::Type
>( field.attribute( QStringLiteral(
"type" ) ).toInt() );
85 QVariant::Type subType =
static_cast< QVariant::Type
>( field.attribute( QStringLiteral(
"subType" ), QStringLiteral(
"0" ) ).toInt() );
86 QString
typeName = field.attribute( QStringLiteral(
"typeName" ) );
96 const auto constMExpressions = mExpressions;