Class: QgsObjectCustomProperties¶
Simple key-value store (keys = strings, values = variants) that supports loading/saving to/from XML in verbatim <customproperties> endverbatim element.
Methods
Returns |
|
Returns a list of all stored keys. |
|
Read store contents from an XML node. |
|
Removes a key (entry) from the store. |
|
Add an entry to the store with the specified key. |
|
Returns the value for the given key. |
|
Writes the store contents to an XML node. |
- class qgis.core.QgsObjectCustomProperties[source]¶
Bases:
object
- contains(self, key: str | None) bool [source]¶
Returns
True
if the properties contains akey
with the specified name.Added in version 3.14.
- Parameters:
key (Optional[str])
- Return type:
bool
- readXml(self, parentNode: QDomNode, keyStartsWith: str | None = '')[source]¶
Read store contents from an XML node.
- Parameters:
parentNode (QDomNode) – node to read from
keyStartsWith (Optional[str] = '') – reads only properties starting with the specified string (or all if the string is empty)
See also
- remove(self, key: str | None)[source]¶
Removes a
key
(entry) from the store.- Parameters:
key (Optional[str])
- setValue(self, key: str | None, value: Any)[source]¶
Add an entry to the store with the specified
key
.If an entry with the same
key
exists already, it will be overwritten.- Parameters:
key (Optional[str])
value (Any)