Class: QgsSettingsTreeNamedListNode

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

Class Hierarchy

Inheritance diagram of qgis.core.QgsSettingsTreeNamedListNode

Base classes

QgsSettingsTreeNode

A tree node for the settings tree to help organizing and introspecting the tree.

class qgis.core.QgsSettingsTreeNamedListNode[source]

Bases: QgsSettingsTreeNode

deleteAllItems(self, parentsNamedItems: Iterable[str | None] = [])[source]

Deletes all items from the named list node

Parameters:

parentsNamedItems (Iterable[Optional[str]] = []) – the list of named items in the parent named list (if any)

Raises:

QgsSettingsException – if the number of given parent named items doesn’t match the complete key definition

Added in version 3.30.1.

deleteItem(self, item: str | None, parentsNamedItems: Iterable[str | None] = [])[source]

Deletes a named item from the named list node

Parameters:
  • item (Optional[str]) – the item to delete

  • parentsNamedItems (Iterable[Optional[str]] = []) – the list of named items in the parent named list (if any)

Raises:

QgsSettingsException – if the number of given parent named items doesn’t match the complete key definition

items(self, parentsNamedItems: Iterable[str | None] = []) List[str][source]

Returns the list of items

Parameters:

parentsNamedItems (Iterable[Optional[str]] = []) – the list of named items in the parent named list (if any)

Raises:

QgsSettingsException – if the number of given parent named items doesn’t match the complete key definition

items(self, origin: Qgis.SettingsOrigin, parentsNamedItems: Iterable[Optional[str]] = []) -> List[str] Returns the list of items

Parameters:
  • origin – can be used to restrict the origin of the setting (local or global)

  • parentsNamedItems – the list of named items in the parent named list (if any)

Raises:

QgsSettingsException – if the number of given parent named items doesn’t match the complete key definition

Return type:

List[str]

selectedItem(self, parentsNamedItems: Iterable[str | None] = []) str[source]

Returns the selected named item from the named list node

Parameters:

parentsNamedItems (Iterable[Optional[str]] = []) – the list of named items in the parent named list (if any)

Raises:

QgsSettingsException – if the number of given parent named items doesn’t match the complete key definition

Return type:

str

selectedItemSetting(self) QgsSettingsEntryString | None[source]

Returns the setting used to store the selected item

Return type:

Optional[QgsSettingsEntryString]

setSelectedItem(self, item: str | None, parentsNamedItems: Iterable[str | None] = [])[source]

Sets the selected named item from the named list node

Parameters:
  • item (Optional[str]) – the item to set as selected

  • parentsNamedItems (Iterable[Optional[str]] = []) – the list of named items in the parent named list (if any)

Raises:

QgsSettingsException – if the number of given parent named items doesn’t match the complete key definition