QGIS API Documentation 3.34.0-Prizren (ffbdd678812)
|
QgsSettingsTreeNode is a tree node for the settings tree to help organizing and introspecting the tree. More...
#include <qgssettingstreenode.h>
Public Member Functions | |
virtual | ~QgsSettingsTreeNode () |
QgsSettingsTreeNode * | childNode (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 QgsSettingsEntryBase * | childSetting (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) | |
QgsSettingsTreeNode * | createChildNode (const QString &key) |
Creates a normal tree node It will return the existing child node if it exists at the given key. | |
QgsSettingsTreeNamedListNode * | createNamedListNode (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. | |
QgsSettingsTreeNode * | parent () 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. | |
Static Public Member Functions | |
static QgsSettingsTreeNode * | createRootNode () |
Creates a tree root node. | |
Protected Member Functions | |
void | registerChildNode (QgsSettingsTreeNode *node) |
Registers a child nodes. | |
Protected Attributes | |
Qgis::SettingsTreeNodeType | mType = Qgis::SettingsTreeNodeType::Root |
Friends | |
class | QgsSettingsTree |
class | QgsSettingsTreeNamedListNode |
QgsSettingsTreeNode is a tree node for the settings tree to help organizing and introspecting the tree.
It is either a root node, a normal node or a named list (to store a group of settings under a dynamic named key). to automatically register a settings entry on its creation when a parent is provided.
Definition at line 44 of file qgssettingstreenode.h.
|
virtual |
Definition at line 24 of file qgssettingstreenode.cpp.
QgsSettingsTreeNode * QgsSettingsTreeNode::childNode | ( | const QString & | key | ) | const |
Returns the existing child node if it exists at the given key.
Definition at line 79 of file qgssettingstreenode.cpp.
|
inline |
Returns the children nodes.
Definition at line 109 of file qgssettingstreenode.h.
|
inline |
Returns the children settings.
Definition at line 115 of file qgssettingstreenode.h.
const QgsSettingsEntryBase * QgsSettingsTreeNode::childSetting | ( | const QString & | key | ) | const |
Returns the existing child settings if it exists at the given key.
Definition at line 90 of file qgssettingstreenode.cpp.
|
inline |
Returns the complete key of the node (including its parents)
Definition at line 127 of file qgssettingstreenode.h.
QgsSettingsTreeNode * QgsSettingsTreeNode::createChildNode | ( | const QString & | key | ) |
Creates a normal tree node It will return the existing child node if it exists at the given key.
QgsSettingsException | if a setting exists with the same key |
Definition at line 42 of file qgssettingstreenode.cpp.
QgsSettingsTreeNamedListNode * QgsSettingsTreeNode::createNamedListNode | ( | const QString & | key, |
const Qgis::SettingsTreeNodeOptions & | options = Qgis::SettingsTreeNodeOptions() |
||
) |
Creates a named list tree node.
This is useful to register groups of settings for several named items (for instance credentials for several named services)
Definition at line 57 of file qgssettingstreenode.cpp.
|
static |
Creates a tree root node.
Definition at line 33 of file qgssettingstreenode.cpp.
|
inline |
Returns the key of the node (without its parents)
Definition at line 124 of file qgssettingstreenode.h.
|
inline |
Returns the number of named nodes in the complete key.
Definition at line 130 of file qgssettingstreenode.h.
|
inline |
Returns the parent of the node or nullptr if it does not exists.
Definition at line 121 of file qgssettingstreenode.h.
|
protected |
Registers a child nodes.
Definition at line 113 of file qgssettingstreenode.cpp.
void QgsSettingsTreeNode::registerChildSetting | ( | const QgsSettingsEntryBase * | setting, |
const QString & | key | ||
) |
Registers a child setting.
setting | the setting to register |
key | the key of the setting (not the complete key from its parents) |
QgsSettingsException | if a setting exists with the same key |
Definition at line 102 of file qgssettingstreenode.cpp.
|
inline |
Returns the type of node.
Definition at line 85 of file qgssettingstreenode.h.
void QgsSettingsTreeNode::unregisterChildNode | ( | QgsSettingsTreeNode * | node | ) |
Unregisters the child tree node.
Definition at line 126 of file qgssettingstreenode.cpp.
void QgsSettingsTreeNode::unregisterChildSetting | ( | const QgsSettingsEntryBase * | setting, |
bool | deleteSettingValues = false , |
||
const QStringList & | parentsNamedItems = QStringList() |
||
) |
Unregisters the child setting.
setting | the setting to unregister |
deleteSettingValues | if true , the values of the settings will also be deleted |
parentsNamedItems | the list of named items in the parent named list (if any) |
Definition at line 118 of file qgssettingstreenode.cpp.
|
friend |
Definition at line 162 of file qgssettingstreenode.h.
|
friend |
Definition at line 163 of file qgssettingstreenode.h.
|
protected |
Definition at line 146 of file qgssettingstreenode.h.