22 #include <QDomElement>
25 #include "qgis_core.h"
49 static QgsRectangle readRectangle(
const QDomElement &element );
62 static QDomElement writeRectangle(
const QgsRectangle &rect, QDomDocument &doc );
76 static QDomElement writeVariant(
const QVariant &value, QDomDocument &doc );
81 static QVariant readVariant(
const QDomElement &element );
94 T value = defaultValue;
96 QMetaEnum metaEnum = QMetaEnum::fromType<T>();
97 QString sourceCategoriesStr( element.attribute( attributeName, metaEnum.valueToKeys(
static_cast<int>( defaultValue ) ) ) );
98 if ( metaEnum.isValid() )
101 int newValue = metaEnum.keysToValue( sourceCategoriesStr.toUtf8().constData(), &ok );
103 value =
static_cast<T
>( newValue );
A rectangle specified with double values.
DistanceUnit
Units of distance.
Assorted helper methods for reading and writing chunks of XML.
static T readFlagAttribute(const QDomElement &element, const QString &attributeName, T defaultValue)
Read a flag value from an attribute of the element.