QGIS API Documentation 3.32.0-Lima (311a8cb8a6)
Public Member Functions | Protected Member Functions | Friends | List of all members
QgsSettingsTreeNamedListNode Class Reference

QgsSettingsTreeNamedListNode is a named list tree node for the settings tree to help organizing and introspecting the tree. More...

#include <qgssettingstreenode.h>

Inheritance diagram for QgsSettingsTreeNamedListNode:
Inheritance graph
[legend]

Public Member Functions

virtual ~QgsSettingsTreeNamedListNode ()
 
void deleteAllItems (const QStringList &parentsNamedItems=QStringList()) SIP_THROW(QgsSettingsException)
 Deletes all items from the named list node. More...
 
void deleteItem (const QString &item, const QStringList &parentsNamedItems=QStringList()) SIP_THROW(QgsSettingsException)
 Deletes a named item from the named list node. More...
 
QStringList items (const QStringList &parentsNamedItems=QStringList()) const SIP_THROW(QgsSettingsException)
 Returns the list of items. More...
 
QStringList items (Qgis::SettingsOrigin origin, const QStringList &parentsNamedItems=QStringList()) const SIP_THROW(QgsSettingsException)
 Returns the list of items. More...
 
QString selectedItem (const QStringList &parentsNamedItems=QStringList()) SIP_THROW(QgsSettingsException)
 Returns the selected named item from the named list node. More...
 
const QgsSettingsEntryStringselectedItemSetting () const
 Returns the setting used to store the selected item. More...
 
void setSelectedItem (const QString &item, const QStringList &parentsNamedItems=QStringList()) SIP_THROW(QgsSettingsException)
 Sets the selected named item from the named list node. More...
 
- Public Member Functions inherited from QgsSettingsTreeNode
virtual ~QgsSettingsTreeNode ()
 
QgsSettingsTreeNodechildNode (const QString &key) const
 Returns the existing child node if it exists at the given key. More...
 
QList< QgsSettingsTreeNode * > childrenNodes () const
 Returns the children nodes. More...
 
QList< const QgsSettingsEntryBase * > childrenSettings () const
 Returns the children settings. More...
 
const QgsSettingsEntryBasechildSetting (const QString &key) const
 Returns the existing child settings if it exists at the given key. More...
 
QString completeKey () const
 Returns the complete key of the node (including its parents) More...
 
QgsSettingsTreeNodecreateChildNode (const QString &key) SIP_THROW(QgsSettingsException)
 Creates a normal tree node It will return the existing child node if it exists at the given key. More...
 
QgsSettingsTreeNamedListNodecreateNamedListNode (const QString &key, const Qgis::SettingsTreeNodeOptions &options=Qgis::SettingsTreeNodeOptions()) SIP_THROW(QgsSettingsException)
 Creates a named list tree node. More...
 
QString key () const
 Returns the key of the node (without its parents) More...
 
int namedNodesCount () const
 Returns the number of named nodes in the complete key. More...
 
QgsSettingsTreeNodeparent () const
 Returns the parent of the node or nullptr if it does not exists. More...
 
void registerChildSetting (const QgsSettingsEntryBase *setting, const QString &key) SIP_THROW(QgsSettingsException)
 Registers a child setting. More...
 
Qgis::SettingsTreeNodeType type () const
 Returns the type of node. More...
 
void unregisterChildNode (QgsSettingsTreeNode *node)
 Unregisters the child tree node. More...
 
void unregisterChildSetting (const QgsSettingsEntryBase *setting, bool deleteSettingValues=false, const QStringList &parentsNamedItems=QStringList())
 Unregisters the child setting. More...
 

Protected Member Functions

void initNamedList (const Qgis::SettingsTreeNodeOptions &options)
 Init the nodes with the specific options. More...
 
- Protected Member Functions inherited from QgsSettingsTreeNode
void registerChildNode (QgsSettingsTreeNode *node)
 Registers a child nodes. More...
 

Friends

class QgsSettingsTreeNode
 

Additional Inherited Members

- Static Public Member Functions inherited from QgsSettingsTreeNode
static QgsSettingsTreeNodecreateRootNode ()
 Creates a tree root node. More...
 
- Protected Attributes inherited from QgsSettingsTreeNode
Qgis::SettingsTreeNodeType mType = Qgis::SettingsTreeNodeType::Root
 

Detailed Description

QgsSettingsTreeNamedListNode is a named list tree node for the settings tree to help organizing and introspecting the tree.

the named list node is used to store a group of settings under a dynamically named key.

See also
QgsSettingsTree
QgsSettingsTreeNode
QgsSettingsEntryBase
Since
QGIS 3.30

Definition at line 191 of file qgssettingstreenode.h.

Constructor & Destructor Documentation

◆ ~QgsSettingsTreeNamedListNode()

QgsSettingsTreeNamedListNode::~QgsSettingsTreeNamedListNode ( )
virtual

Definition at line 153 of file qgssettingstreenode.cpp.

Member Function Documentation

◆ deleteAllItems()

void QgsSettingsTreeNamedListNode::deleteAllItems ( const QStringList &  parentsNamedItems = QStringList())

Deletes all items from the named list node.

Parameters
parentsNamedItemsthe list of named items in the parent named list (if any)
Exceptions
QgsSettingsExceptionif the number of given parent named items doesn't match the complete key definition
Since
QGIS 3.30.1

Definition at line 207 of file qgssettingstreenode.cpp.

◆ deleteItem()

void QgsSettingsTreeNamedListNode::deleteItem ( const QString &  item,
const QStringList &  parentsNamedItems = QStringList() 
)

Deletes a named item from the named list node.

Parameters
itemthe item to delete
parentsNamedItemsthe list of named items in the parent named list (if any)
Exceptions
QgsSettingsExceptionif the number of given parent named items doesn't match the complete key definition

Definition at line 196 of file qgssettingstreenode.cpp.

◆ initNamedList()

void QgsSettingsTreeNamedListNode::initNamedList ( const Qgis::SettingsTreeNodeOptions &  options)
protected

Init the nodes with the specific options.

Definition at line 139 of file qgssettingstreenode.cpp.

◆ items() [1/2]

QStringList QgsSettingsTreeNamedListNode::items ( const QStringList &  parentsNamedItems = QStringList()) const

Returns the list of items.

Parameters
parentsNamedItemsthe list of named items in the parent named list (if any)
Exceptions
QgsSettingsExceptionif the number of given parent named items doesn't match the complete key definition

Definition at line 159 of file qgssettingstreenode.cpp.

◆ items() [2/2]

QStringList QgsSettingsTreeNamedListNode::items ( Qgis::SettingsOrigin  origin,
const QStringList &  parentsNamedItems = QStringList() 
) const

Returns the list of items.

Parameters
origincan be used to restrict the origin of the setting (local or global)
parentsNamedItemsthe list of named items in the parent named list (if any)
Exceptions
QgsSettingsExceptionif the number of given parent named items doesn't match the complete key definition

Definition at line 164 of file qgssettingstreenode.cpp.

◆ selectedItem()

QString QgsSettingsTreeNamedListNode::selectedItem ( const QStringList &  parentsNamedItems = QStringList())

Returns the selected named item from the named list node.

Parameters
parentsNamedItemsthe list of named items in the parent named list (if any)
Exceptions
QgsSettingsExceptionif the number of given parent named items doesn't match the complete key definition

Definition at line 186 of file qgssettingstreenode.cpp.

◆ selectedItemSetting()

const QgsSettingsEntryString * QgsSettingsTreeNamedListNode::selectedItemSetting ( ) const
inline

Returns the setting used to store the selected item.

Definition at line 244 of file qgssettingstreenode.h.

◆ setSelectedItem()

void QgsSettingsTreeNamedListNode::setSelectedItem ( const QString &  item,
const QStringList &  parentsNamedItems = QStringList() 
)

Sets the selected named item from the named list node.

Parameters
itemthe item to set as selected
parentsNamedItemsthe list of named items in the parent named list (if any)
Exceptions
QgsSettingsExceptionif the number of given parent named items doesn't match the complete key definition

Definition at line 176 of file qgssettingstreenode.cpp.

Friends And Related Function Documentation

◆ QgsSettingsTreeNode

friend class QgsSettingsTreeNode
friend

Definition at line 251 of file qgssettingstreenode.h.


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