Class: QgsProjectPropertyKey¶
Project property key node.
Can, itself, contain QgsProjectPropertyKey
and
QgsProjectPropertyValues
.
The internal QHash, mProperties, maps key names to their respective
QgsProjectPropertyValue
or next
QgsProjectPropertyKey
in the key name sequence. The key with
the current name should contain its QgsProjectPropertyValue
.
E.g., given the key sequence “/foo/bar”, “foo” will have a corresponding
QgsProjectPropertyKey
with a name “foo”. It will contain an
element in its mProperties that maps to “bar”, which is another
QgsProjectPropertyKey
. The “bar”
QgsProjectPropertyKey
will, in turn, have an element that
maps to itself, i.e. “bar”, that will contain a
QgsProjectPropertyValue
.
Class Hierarchy¶
Base classes¶
An abstract base class for QGIS project property hierarchys. |
Abstract Methods
If this key has a value, it will be stored by its name in its properties |
Methods
Adds the specified property key as a sub-key. |
|
Returns the number of sub-keys contained by this property. |
|
Returns any sub-keys contained by this property that do not contain other keys. |
|
Attempts to find a property with a matching sub-key name. |
|
Returns |
|
The name of the property is used as identifier. |
|
Removes the specified key. |
|
The name of the property is used as identifier. |
|
Sets the value associated with this key. |
|
Returns any sub-keys contained by this property which themselves contain other keys. |
Virtual Methods
In PyQGIS, only methods marked as virtual
can be safely overridden in a Python subclass of QgsProjectPropertyKey. See the FAQ for more details.
Resets the property to a default, empty state. |
|
Deletes any sub-nodes from the property. |
- class qgis.core.QgsProjectPropertyKey[source]¶
Bases:
QgsProjectProperty
- __init__(name: str | None = '')
Create a new QgsProjectPropertyKey with the specified identifier.
- Parameters:
name (Optional[str] = '')
- __init__(a0: QgsProjectPropertyKey)
- Parameters:
- addKey(self, keyName: str | None) QgsProjectPropertyKey | None [source]¶
Adds the specified property key as a sub-key.
- Parameters:
keyName (Optional[str])
- Return type:
Optional[QgsProjectPropertyKey]
- count(self) int [source]¶
Returns the number of sub-keys contained by this property.
- Return type:
int
- entryList(self, entries: Iterable[str | None])[source]¶
Returns any sub-keys contained by this property that do not contain other keys.
See also
- Parameters:
entries (Iterable[Optional[str]])
- find(self, propertyName: str | None) QgsProjectProperty | None [source]¶
Attempts to find a property with a matching sub-key name.
- Parameters:
propertyName (Optional[str])
- Return type:
Optional[QgsProjectProperty]
- removeKey(self, keyName: str | None)[source]¶
Removes the specified key.
- Parameters:
keyName (Optional[str])
- setName(self, name: str | None)[source]¶
The name of the property is used as identifier.
See also
- Parameters:
name (Optional[str])
- setValue(self, name: str | None, value: Any) QgsProjectPropertyValue | None [source]¶
Sets the value associated with this key.
- Parameters:
name (Optional[str]) – is the key name
value (Any) – is the value to set
- Return type:
Optional[QgsProjectPropertyValue]
- Returns:
pointer to property value
- setValue(self, value: Any) QgsProjectPropertyValue | None [source]
Set the value associated with this key
Note
that the single value node associated with each key is always stored keyed by the current key name
- Parameters:
value (Any)
- Return type:
Optional[QgsProjectPropertyValue]