Simple key-value store (keys = strings, values = variants) that supports loading/saving to/from XML in.
More...
#include <qgsobjectcustomproperties.h>
Public Member Functions |
| QgsObjectCustomProperties () |
QStringList | keys () const |
| Return list of stored keys.
|
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.
|
QVariant | value (const QString &key, const QVariant &defaultValue=QVariant()) const |
| Return value for the given key. If the key is not stored, default value will be used.
|
void | remove (const QString &key) |
| Remove a key (entry) from the store.
|
void | readXml (const QDomNode &parentNode, const QString &keyStartsWith=QString()) |
| Read store contents from XML.
|
void | writeXml (QDomNode &parentNode, QDomDocument &doc) const |
| Write store contents to XML.
|
Protected Attributes |
QMap< QString, QVariant > | mMap |
Detailed Description
Simple key-value store (keys = strings, values = variants) that supports loading/saving to/from XML in.
<customproperties>
element.
- Note
- added in 2.4
Constructor & Destructor Documentation
QgsObjectCustomProperties::QgsObjectCustomProperties |
( |
| ) |
|
Member Function Documentation
QStringList QgsObjectCustomProperties::keys |
( |
| ) |
const |
Return list of stored keys.
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) |
void QgsObjectCustomProperties::remove |
( |
const QString & |
key | ) |
|
Remove a key (entry) from the store.
void QgsObjectCustomProperties::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.
QVariant QgsObjectCustomProperties::value |
( |
const QString & |
key, |
|
|
const QVariant & |
defaultValue = QVariant() |
|
) |
| const |
Return value for the given key. If the key is not stored, default value will be used.
void QgsObjectCustomProperties::writeXml |
( |
QDomNode & |
parentNode, |
|
|
QDomDocument & |
doc |
|
) |
| const |
Write store contents to XML.
Member Data Documentation
QMap<QString, QVariant> QgsObjectCustomProperties::mMap |
|
protected |
The documentation for this class was generated from the following files: