Simple key-value store (keys = strings, values = variants) that supports loading/saving to/from XML in.
More...
#include <qgsobjectcustomproperties.h>
|
| QgsObjectCustomProperties ()=default |
| Constructor for QgsObjectCustomProperties. More...
|
|
bool | contains (const QString &key) const |
| Returns true if the properties contains a key with the specified name. More...
|
|
QStringList | keys () const |
| Returns a list of all stored keys. More...
|
|
void | readXml (const QDomNode &parentNode, const QString &keyStartsWith=QString()) |
| Read store contents from an XML node. More...
|
|
void | remove (const QString &key) |
| Removes a key (entry) from the store. More...
|
|
void | setValue (const QString &key, const QVariant &value) |
| Add an entry to the store with the specified key. More...
|
|
QVariant | value (const QString &key, const QVariant &defaultValue=QVariant()) const |
| Returns the value for the given key. More...
|
|
void | writeXml (QDomNode &parentNode, QDomDocument &doc) const |
| Writes the store contents to an XML node. More...
|
|
|
QMap< QString, QVariant > | mMap |
|
Simple key-value store (keys = strings, values = variants) that supports loading/saving to/from XML in.
<customproperties>
element.
- Since
- QGIS 2.4
Definition at line 35 of file qgsobjectcustomproperties.h.
◆ QgsObjectCustomProperties()
QgsObjectCustomProperties::QgsObjectCustomProperties |
( |
| ) |
|
|
default |
◆ contains()
bool QgsObjectCustomProperties::contains |
( |
const QString & |
key | ) |
const |
◆ keys()
QStringList QgsObjectCustomProperties::keys |
( |
| ) |
const |
◆ readXml()
void QgsObjectCustomProperties::readXml |
( |
const QDomNode & |
parentNode, |
|
|
const QString & |
keyStartsWith = QString() |
|
) |
| |
Read store contents from an XML node.
- Parameters
-
parentNode | node to read from |
keyStartsWith | reads only properties starting with the specified string (or all if the string is empty) |
- See also
- writeXml()
Definition at line 51 of file qgsobjectcustomproperties.cpp.
◆ remove()
void QgsObjectCustomProperties::remove |
( |
const QString & |
key | ) |
|
◆ setValue()
void QgsObjectCustomProperties::setValue |
( |
const QString & |
key, |
|
|
const QVariant & |
value |
|
) |
| |
Add an entry to the store with the specified key.
If an entry with the same key exists already, it will be overwritten.
Definition at line 31 of file qgsobjectcustomproperties.cpp.
◆ value()
QVariant QgsObjectCustomProperties::value |
( |
const QString & |
key, |
|
|
const QVariant & |
defaultValue = QVariant() |
|
) |
| const |
Returns the value for the given key.
If the key is not present in the properties, the defaultValue will be returned.
Definition at line 36 of file qgsobjectcustomproperties.cpp.
◆ writeXml()
void QgsObjectCustomProperties::writeXml |
( |
QDomNode & |
parentNode, |
|
|
QDomDocument & |
doc |
|
) |
| const |
◆ mMap
QMap<QString, QVariant> QgsObjectCustomProperties::mMap |
|
protected |
The documentation for this class was generated from the following files: