Class: QgsProjectPropertyKey¶
-
class
qgis.core.
QgsProjectPropertyKey
(name: str = '')¶ Bases:
qgis._core.QgsProjectProperty
Create a new QgsProjectPropertyKey with the specified identifier.
QgsProjectPropertyKey(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.New in version 3.0: Enums
Methods
Adds the specified property key as a sub-key.
Resets the property to a default, empty state.
Deletes any sub-nodes from the property.
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 true if this property contains no sub-keys.
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.
If this key has a value, it will be stored by its name in its properties
Signals
Attributes
-
addKey
(self, keyName: str) → QgsProjectPropertyKey¶ Adds the specified property key as a sub-key.
-
clear
(self)¶ Resets the property to a default, empty state.
-
clearKeys
(self)¶ Deletes any sub-nodes from the property.
-
count
(self) → int¶ Returns the number of sub-keys contained by this property.
-
dump
(self, tabs: int = 0)¶
-
entryList
(self, entries: Iterable[str])¶ Returns any sub-keys contained by this property that do not contain other keys.
See also
-
find
(self, propertyName: str) → QgsProjectProperty¶ Attempts to find a property with a matching sub-key name.
-
isEmpty
(self) → bool¶ Returns true if this property contains no sub-keys.
-
isKey
(self) → bool¶
-
isLeaf
(self) → bool¶
-
isValue
(self) → bool¶
-
readXml
(self, keyNode: QDomNode) → bool¶
-
removeKey
(self, keyName: str)¶ Removes the specified key.
-
setName
(self, name: str)¶ The name of the property is used as identifier.
See also
New in version 3.0.
-
setValue
(self, name: str, value: Any) → QgsProjectPropertyValue¶ Sets the value associated with this key.
- Parameters
name – is the key name
value – is the value to set
- Returns
pointer to property value
setValue(self, value: Any) -> QgsProjectPropertyValue 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
-
subkeyList
(self, entries: Iterable[str])¶ Returns any sub-keys contained by this property which themselves contain other keys.
See also
-
value
(self) → Any¶ If this key has a value, it will be stored by its name in its properties
-
writeXml
(self, nodeName: str, element: QDomElement, document: QDomDocument) → bool¶
-