QGIS API Documentation 3.41.0-Master (3440c17df1d)
Loading...
Searching...
No Matches
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.
 
void deleteItem (const QString &item, const QStringList &parentsNamedItems=QStringList())
 Deletes a named item from the named list node.
 
QStringList items (const QStringList &parentsNamedItems=QStringList()) const
 Returns the list of items.
 
QStringList items (Qgis::SettingsOrigin origin, const QStringList &parentsNamedItems=QStringList()) const
 Returns the list of items.
 
QString selectedItem (const QStringList &parentsNamedItems=QStringList())
 Returns the selected named item from the named list node.
 
const QgsSettingsEntryStringselectedItemSetting () const
 Returns the setting used to store the selected item.
 
void setSelectedItem (const QString &item, const QStringList &parentsNamedItems=QStringList())
 Sets the selected named item from the named list node.
 
- 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.
 
QList< QgsSettingsTreeNode * > childrenNodes () const
 Returns the children nodes.
 
QList< const QgsSettingsEntryBase * > childrenSettings () const
 Returns the children settings.
 
const QgsSettingsEntryBasechildSetting (const QString &key) const
 Returns the existing child settings if it exists at the given key.
 
QString completeKey () const
 Returns the complete key of the node (including its parents)
 
QgsSettingsTreeNodecreateChildNode (const QString &key)
 Creates a normal tree node It will return the existing child node if it exists at the given key.
 
QgsSettingsTreeNamedListNodecreateNamedListNode (const QString &key, const Qgis::SettingsTreeNodeOptions &options=Qgis::SettingsTreeNodeOptions())
 Creates a named list tree node.
 
QString key () const
 Returns the key of the node (without its parents)
 
int namedNodesCount () const
 Returns the number of named nodes in the complete key.
 
QgsSettingsTreeNodeparent () const
 Returns the parent of the node or nullptr if it does not exists.
 
void registerChildSetting (const QgsSettingsEntryBase *setting, const QString &key)
 Registers a child setting.
 
Qgis::SettingsTreeNodeType type () const
 Returns the type of node.
 
void unregisterChildNode (QgsSettingsTreeNode *node)
 Unregisters the child tree node.
 
void unregisterChildSetting (const QgsSettingsEntryBase *setting, bool deleteSettingValues=false, const QStringList &parentsNamedItems=QStringList())
 Unregisters the child setting.
 

Protected Member Functions

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

Friends

class QgsSettingsTreeNode
 

Additional Inherited Members

- Static Public Member Functions inherited from QgsSettingsTreeNode
static QgsSettingsTreeNodecreateRootNode ()
 Creates a tree root node.
 
- 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 190 of file qgssettingstreenode.h.

Constructor & Destructor Documentation

◆ ~QgsSettingsTreeNamedListNode()

QgsSettingsTreeNamedListNode::~QgsSettingsTreeNamedListNode ( )
virtual

Definition at line 162 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 218 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 207 of file qgssettingstreenode.cpp.

◆ initNamedList()

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

Init the nodes with the specific options.

Definition at line 148 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 168 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 173 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 197 of file qgssettingstreenode.cpp.

◆ selectedItemSetting()

const QgsSettingsEntryString * QgsSettingsTreeNamedListNode::selectedItemSetting ( ) const
inline

Returns the setting used to store the selected item.

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

Friends And Related Symbol Documentation

◆ QgsSettingsTreeNode

friend class QgsSettingsTreeNode
friend

Definition at line 250 of file qgssettingstreenode.h.


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