QGIS API Documentation 3.41.0-Master (cea29feecf2)
Loading...
Searching...
No Matches
Public Member Functions | List of all members
QgsProjectPropertyValue Class Reference

Project property value node, contains a QgsProjectPropertyKey's value. More...

#include <qgsprojectproperty.h>

Inheritance diagram for QgsProjectPropertyValue:
Inheritance graph
[legend]

Public Member Functions

 QgsProjectPropertyValue ()=default
 
 QgsProjectPropertyValue (const QVariant &value)
 Constructor for QgsProjectPropertyValue, initialized to a specified value.
 
void dump (int tabs=0) const override
 Dumps out the keys and values.
 
bool isKey () const override
 Returns true if the property is a QgsProjectPropertyKey.
 
bool isLeaf () const override
 Returns true if property is a leaf node.
 
bool isValue () const override
 Returns true if the property is a QgsProjectPropertyValue.
 
bool readXml (const QDomNode &keyNode) override
 Restores the property hierarchy from a specified DOM node.
 
QVariant value () const override
 Returns the node's value.
 
bool writeXml (const QString &nodeName, QDomElement &element, QDomDocument &document) override
 Writes the property hierarchy to a specified DOM element.
 
- Public Member Functions inherited from QgsProjectProperty
 QgsProjectProperty ()
 
virtual ~QgsProjectProperty ()=default
 

Detailed Description

Project property value node, contains a QgsProjectPropertyKey's value.

Definition at line 126 of file qgsprojectproperty.h.

Constructor & Destructor Documentation

◆ QgsProjectPropertyValue() [1/2]

QgsProjectPropertyValue::QgsProjectPropertyValue ( )
default

◆ QgsProjectPropertyValue() [2/2]

QgsProjectPropertyValue::QgsProjectPropertyValue ( const QVariant &  value)
inline

Constructor for QgsProjectPropertyValue, initialized to a specified value.

Definition at line 135 of file qgsprojectproperty.h.

Member Function Documentation

◆ dump()

void QgsProjectPropertyValue::dump ( int  tabs = 0) const
overridevirtual

Dumps out the keys and values.

Parameters
tabsis number of tabs to print; used for pretty-printing hierarchy

Implements QgsProjectProperty.

Definition at line 30 of file qgsprojectproperty.cpp.

◆ isKey()

bool QgsProjectPropertyValue::isKey ( ) const
inlineoverridevirtual

Returns true if the property is a QgsProjectPropertyKey.

See also
isValue()
isLeaf()

Implements QgsProjectProperty.

Definition at line 139 of file qgsprojectproperty.h.

◆ isLeaf()

bool QgsProjectPropertyValue::isLeaf ( ) const
inlineoverridevirtual

Returns true if property is a leaf node.

A leaf node is a key node that has either no value or only a single value. A non-leaf node would be a key node with key sub-nodes.

This is used for entryList() and subkeyList() implementation.

Implements QgsProjectProperty.

Definition at line 144 of file qgsprojectproperty.h.

◆ isValue()

bool QgsProjectPropertyValue::isValue ( ) const
inlineoverridevirtual

Returns true if the property is a QgsProjectPropertyValue.

See also
isKey()
isLeaf()

Implements QgsProjectProperty.

Definition at line 140 of file qgsprojectproperty.h.

◆ readXml()

bool QgsProjectPropertyValue::readXml ( const QDomNode &  keyNode)
overridevirtual

Restores the property hierarchy from a specified DOM node.

Used for restoring properties from project file

Implements QgsProjectProperty.

Definition at line 54 of file qgsprojectproperty.cpp.

◆ value()

QVariant QgsProjectPropertyValue::value ( ) const
inlineoverridevirtual

Returns the node's value.

For QgsProjectPropertyValue nodes, this is straightforward – just return the embedded QVariant, _value. For QgsProjectPropertyKey, this means returning the QgsProjectPropertyValue _value that is keyed by its name, if it exists; i.e., QgsProjectPropertyKey "foo" will return the property value mapped to its name, "foo", in its QHash of QProperties.

Implements QgsProjectProperty.

Definition at line 141 of file qgsprojectproperty.h.

◆ writeXml()

bool QgsProjectPropertyValue::writeXml ( const QString &  nodeName,
QDomElement &  element,
QDomDocument &  document 
)
overridevirtual

Writes the property hierarchy to a specified DOM element.

Used for saving properties to project file.

Parameters
nodeNamethe tag name associated with this element
elementthe parent (or encompassing) property element
documentthe overall project file Dom document

Implements QgsProjectProperty.

Definition at line 235 of file qgsprojectproperty.cpp.


The documentation for this class was generated from the following files: