49 static QgsRectangle readRectangle(
const QDomElement &element );
69 static QDomElement writeRectangle(
const QgsRectangle &rect, QDomDocument &doc,
const QString &elementName = QStringLiteral(
"extent" ) );
83 static QDomElement writeVariant(
const QVariant &value, QDomDocument &doc );
88 static QVariant readVariant(
const QDomElement &element );
101 T value = defaultValue;
103 const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
104 const QString sourceCategoriesStr( element.attribute( attributeName, metaEnum.valueToKeys(
static_cast<int>( defaultValue ) ) ) );
105 if ( metaEnum.isValid() )
108 const int newValue = metaEnum.keysToValue( sourceCategoriesStr.toUtf8().constData(), &ok );
110 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.