Assorted helper methods for reading and writing chunks of XML.
More...
#include <qgsxmlutils.h>
|
| static QgsBox3D | readBox3D (const QDomElement &element) |
| | Decodes a DOM element to a 3D box.
|
| |
| template<class T > |
| static T | readFlagAttribute (const QDomElement &element, const QString &attributeName, T defaultValue) |
| | Read a flag value from an attribute of the element.
|
| |
| static Qgis::DistanceUnit | readMapUnits (const QDomElement &element) |
| | Decodes a distance unit from a DOM element.
|
| |
| static QgsRectangle | readRectangle (const QDomElement &element) |
| |
| static QVariant | readVariant (const QDomElement &element) |
| | Read a QVariant from a QDomElement.
|
| |
| static QDomElement | writeBox3D (const QgsBox3D &box, QDomDocument &doc, const QString &elementName=QStringLiteral("extent3D")) |
| | Encodes a 3D box to a DOM element.
|
| |
| static QDomElement | writeMapUnits (Qgis::DistanceUnit units, QDomDocument &doc) |
| | Encodes a distance unit to a DOM element.
|
| |
| static QDomElement | writeRectangle (const QgsRectangle &rect, QDomDocument &doc, const QString &elementName=QStringLiteral("extent")) |
| | Encodes a rectangle to a DOM element.
|
| |
| static QDomElement | writeVariant (const QVariant &value, QDomDocument &doc) |
| | Write a QVariant to a QDomElement.
|
| |
Assorted helper methods for reading and writing chunks of XML.
Definition at line 36 of file qgsxmlutils.h.
◆ readBox3D()
| QgsBox3D QgsXmlUtils::readBox3D |
( |
const QDomElement & |
element | ) |
|
|
static |
Decodes a DOM element to a 3D box.
- Parameters
-
- Returns
- decoded 3D box
- Since
- QGIS 3.36
Definition at line 39 of file qgsxmlutils.cpp.
◆ readFlagAttribute()
template<class T >
| static T QgsXmlUtils::readFlagAttribute |
( |
const QDomElement & |
element, |
|
|
const QString & |
attributeName, |
|
|
T |
defaultValue |
|
) |
| |
|
inlinestatic |
Read a flag value from an attribute of the element.
- Parameters
-
| element | the element to read the attribute from |
| attributeName | the attribute name |
| defaultValue | the default value as a flag |
- Note
- The flag value is a text as returned by
- See also
- QMetaEnum::valueToKeys. The flag must have been declared with Q_ENUM macro.
- Since
- QGIS 3.4
Definition at line 118 of file qgsxmlutils.h.
◆ readMapUnits()
Decodes a distance unit from a DOM element.
- Parameters
-
| element | DOM element to decode |
- Returns
- distance units
- See also
- writeMapUnits()
Definition at line 26 of file qgsxmlutils.cpp.
◆ readRectangle()
| QgsRectangle QgsXmlUtils::readRectangle |
( |
const QDomElement & |
element | ) |
|
|
static |
◆ readVariant()
| QVariant QgsXmlUtils::readVariant |
( |
const QDomElement & |
element | ) |
|
|
static |
◆ writeBox3D()
| QDomElement QgsXmlUtils::writeBox3D |
( |
const QgsBox3D & |
box, |
|
|
QDomDocument & |
doc, |
|
|
const QString & |
elementName = QStringLiteral( "extent3D" ) |
|
) |
| |
|
static |
Encodes a 3D box to a DOM element.
- Parameters
-
| box | 3D box to encode |
| doc | DOM document |
| elementName | name of the DOM element |
- Returns
- element containing encoded 3D box
- Since
- QGIS 3.36
Definition at line 106 of file qgsxmlutils.cpp.
◆ writeMapUnits()
Encodes a distance unit to a DOM element.
- Parameters
-
| units | units to encode |
| doc | DOM document |
- Returns
- element containing encoded units
- See also
- readMapUnits()
Definition at line 94 of file qgsxmlutils.cpp.
◆ writeRectangle()
| QDomElement QgsXmlUtils::writeRectangle |
( |
const QgsRectangle & |
rect, |
|
|
QDomDocument & |
doc, |
|
|
const QString & |
elementName = QStringLiteral( "extent" ) |
|
) |
| |
|
static |
Encodes a rectangle to a DOM element.
- Parameters
-
| rect | rectangle to encode |
| doc | DOM document |
| elementName | name of the DOM element |
- Returns
- element containing encoded rectangle
Definition at line 119 of file qgsxmlutils.cpp.
◆ writeVariant()
| QDomElement QgsXmlUtils::writeVariant |
( |
const QVariant & |
value, |
|
|
QDomDocument & |
doc |
|
) |
| |
|
static |
Write a QVariant to a QDomElement.
Supported types are
Definition at line 144 of file qgsxmlutils.cpp.
The documentation for this class was generated from the following files: