Class: QgsSettingsTreeNamedListNode

class qgis.core.QgsSettingsTreeNamedListNode

Bases: QgsSettingsTreeNode

QgsSettingsTreeNamedListNode is a named list tree node for the settings registry to help organizing and introspecting the registry. the named list node is used to store a group of settings under a dynamically named key.

New in version 3.30:

Methods

deleteItem

Deletes a named item from the named list node

items

Returns the list of items

selectedItem

Returns the selected named item from the named list node

selectedItemSetting

Returns the setting used to store the selected item

setSelectedItem

Sets the selected named item from the named list node

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

Deletes a named item from the named list node

Parameters
  • item (str) – the item to delete

  • parentsNamedItems (Iterable[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] = []) List[str]

Returns the list of items

Parameters

parentsNamedItems (Iterable[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[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] = []) str

Returns the selected named item from the named list node

Parameters

parentsNamedItems (Iterable[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

Returns the setting used to store the selected item

Return type

QgsSettingsEntryString

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

Sets the selected named item from the named list node

Parameters
  • item (str) – the item to set as selected

  • parentsNamedItems (Iterable[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