50 static QgsRectangle readRectangle(
const QDomElement &element );
58 static QgsBox3D readBox3D(
const QDomElement &element );
79 static QDomElement writeBox3D(
const QgsBox3D &box, QDomDocument &doc,
const QString &elementName = QStringLiteral(
"extent3D" ) );
88 static QDomElement writeRectangle(
const QgsRectangle &rect, QDomDocument &doc,
const QString &elementName = QStringLiteral(
"extent" ) );
102 static QDomElement writeVariant(
const QVariant &value, QDomDocument &doc );
107 static QVariant readVariant(
const QDomElement &element );
120 T value = defaultValue;
122 const QMetaEnum metaEnum = QMetaEnum::fromType<T>();
123 const QString sourceCategoriesStr( element.attribute( attributeName, metaEnum.valueToKeys(
static_cast<int>( defaultValue ) ) ) );
124 if ( metaEnum.isValid() )
127 const int newValue = metaEnum.keysToValue( sourceCategoriesStr.toUtf8().constData(), &ok );
129 value =
static_cast<T
>( newValue );