QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
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())
 Deletes all items from the named list node. More...
 
void deleteItem (const QString &item, const QStringList &parentsNamedItems=QStringList())
 Deletes a named item from the named list node. More...
 
QStringList items (const QStringList &parentsNamedItems=QStringList()) const
 Returns the list of items. More...
 
QStringList items (Qgis::SettingsOrigin origin, const QStringList &parentsNamedItems=QStringList()) const
 Returns the list of items. More...
 
QString selectedItem (const QStringList &parentsNamedItems=QStringList())
 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())
 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)
 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())
 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)
 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 189 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 209 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 198 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 188 of file qgssettingstreenode.cpp.

◆ selectedItemSetting()

const QgsSettingsEntryString * QgsSettingsTreeNamedListNode::selectedItemSetting ( ) const
inline

Returns the setting used to store the selected item.

Definition at line 242 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 178 of file qgssettingstreenode.cpp.

Friends And Related Function Documentation

◆ QgsSettingsTreeNode

friend class QgsSettingsTreeNode
friend

Definition at line 249 of file qgssettingstreenode.h.


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