Class: QgsSettingsTree

Holds the tree structure for the settings in QGIS core.

Added in version 3.30.

List of all members, including inherited members

Methods

node

Returns the tree node at the given key

Static Methods

createPluginTreeNode

Creates a settings tree node for the given pluginName.

treeRoot

Returns the tree root node for the settings tree

unregisterPluginTreeNode

Unregisters the tree node for the given plugin.

class qgis.core.QgsSettingsTree[source]

Bases: object

static createPluginTreeNode(pluginName: str | None) QgsSettingsTreeNode | None[source]

Creates a settings tree node for the given pluginName.

Note

Since QGIS 4.2 for Python plugins, the node is created automatically by QGIS when the plugin is started and is exposed as the SETTINGS_NODE attribute on the plugin package. Plugin authors should retrieve it with from <my_plugin> import SETTINGS_NODE rather than calling this method directly.

Parameters:

pluginName (Optional[str])

Return type:

Optional[QgsSettingsTreeNode]

node(key: str | None) QgsSettingsTreeNode | None[source]

Returns the tree node at the given key

Note

For Plugins, use createPluginTreeNode() to create nodes for plugin settings.

Parameters:

key (Optional[str])

Return type:

Optional[QgsSettingsTreeNode]

static treeRoot() QgsSettingsTreeNode | None[source]

Returns the tree root node for the settings tree

Return type:

Optional[QgsSettingsTreeNode]

static unregisterPluginTreeNode(pluginName: str | None)[source]

Unregisters the tree node for the given plugin.

Note

Since QGIS 4.2 for Python plugins, the node is unregistered automatically by QGIS when the plugin is unloaded; plugins do not need to call this method themselves.

Parameters:

pluginName (Optional[str])