QgsObjectCustomProperties class
Simple key-value store (keys = strings, values = variants) that supports loading/saving to/from XML in.
Contents
<customproperties>
element.
Constructors, destructors, conversion operators
- QgsObjectCustomProperties() defaulted
- Constructor for QgsObjectCustomProperties.
Public functions
- auto keys() const -> QStringList
- Returns list of stored keys.
- void readXml(const QDomNode& parentNode, const QString& keyStartsWith = QString())
- Read store contents from XML.
- void remove(const QString& key)
- Remove a key (entry) from the store.
- void setValue(const QString& key, const QVariant& value)
- Add an entry to the store. If the entry with the keys exists already, it will be overwritten.
- auto value(const QString& key, const QVariant& defaultValue = QVariant()) const -> QVariant
- Returns value for the given key. If the key is not stored, default value will be used.
- void writeXml(QDomNode& parentNode, QDomDocument& doc) const
- Write store contents to XML.
Function documentation
void QgsObjectCustomProperties:: readXml(const QDomNode& parentNode,
const QString& keyStartsWith = QString())
Read store contents from XML.
| Parameters | |
|---|---|
| parentNode | node to read from |
| keyStartsWith | reads only properties starting with the specified string (or all if the string is empty) |