Class: QgsMeshDatasetGroupTreeItem

Tree item for display of the mesh dataset groups.

Dataset groups are sets of datasets with the same name, but different control variable (e.g. time)

Support for multiple levels, because groups can have subgroups, for example

+ Groups:
  + Depth
    + Minimum
    + Maximum
  + Velocity
  + Wind speed
     + Minimum
     + Maximum

Tree items handle also the dependencies between dataset groups represented by these items.

Added in version 3.14.

Methods

appendChild

Appends a child item.

child

Returns a child

childCount

Returns the count of children

childFromDatasetGroupIndex

Returns the child with dataset group index Searches as depper as needed on the child hierarchy

clone

Clones the item

datasetGroupIndex

Returns the dataset group index.

datasetGroupType

Returns the dataset group type.

defaultName

Returns the default name.

description

Returns description about the dataset group (URI, formula,...)

enabledDatasetGroupIndexes

Returns a list of enabled dataset group indexes, included deeper children

groupIndexDependencies

Returns a list of group index corresponding to dataset group that depends on the dataset group represented by this item

isEnabled

Returns True if the item is enabled, i.e. if it is displayed in view.

isVector

Return True if the dataset group is vector.

name

Returns the name of the item This name is the default name if the name has not been overridden (setName())

parentItem

Returns the parent item, None if it is root item

providerName

Returns the name used by the provider to identify the dataset

removeChild

Removes and destroy a item child if exists

row

Returns the position of the item in the parent

setDatasetGroup

Set parameters of the item in accordance with the dataset group

setIsEnabled

Sets whether the item is enabled, that is if it is displayed in view

setName

Overrides the default name with the name to display.

setPersistentDatasetGroup

Set parameters of the item in accordance with the persistent dataset group with uri

totalChildCount

Returns the total count of children, that is included deeper children and disabled items

writeXml

Writes the item and its children in a DOM document

class qgis.core.QgsMeshDatasetGroupTreeItem[source]

Bases: object

__init__()

Constructor for an empty dataset group tree item

__init__(defaultName: str | None, sourceName: str | None, isVector: bool, index: int)

Constructor

Parameters:
  • defaultName (Optional[str]) – the name that will be used to display the item if iot not overrides (setName())

  • sourceName (Optional[str]) – the name used by the source (provider, dataset group store,…)

  • isVector (bool) – whether the dataset group is a vector dataset group

  • index (int) – index of the dataset group

__init__(itemElement: QDomElement, context: QgsReadWriteContext)

Constructor from a DOM element, constructs also the children

Parameters:
  • itemElement (QDomElement) – the DOM element

  • context (QgsReadWriteContext) – writing context (e.g. for conversion between relative and absolute paths)

__init__(a0: QgsMeshDatasetGroupTreeItem)
Parameters:

a0 (QgsMeshDatasetGroupTreeItem)

appendChild(self, item: QgsMeshDatasetGroupTreeItem | None)[source]

Appends a child item.

Note

takes ownership of item

Parameters:

item (Optional[QgsMeshDatasetGroupTreeItem])

child(self, row: int) QgsMeshDatasetGroupTreeItem | None[source]

Returns a child

Parameters:

row (int) – the position of the child

Return type:

Optional[QgsMeshDatasetGroupTreeItem]

Returns:

the item at the position row

childCount(self) int[source]

Returns the count of children

Return type:

int

Returns:

the children’s count

childFromDatasetGroupIndex(self, index: int) QgsMeshDatasetGroupTreeItem | None[source]

Returns the child with dataset group index Searches as depper as needed on the child hierarchy

Parameters:

index (int) – the index of the dataset group index

Return type:

Optional[QgsMeshDatasetGroupTreeItem]

Returns:

the item with index as dataset group index, None if no item is found

clone(self) QgsMeshDatasetGroupTreeItem | None[source]

Clones the item

Return type:

Optional[QgsMeshDatasetGroupTreeItem]

Returns:

the cloned item

datasetGroupIndex(self) int[source]

Returns the dataset group index.

Return type:

int

datasetGroupType(self) QgsMeshDatasetGroup.Type[source]

Returns the dataset group type.

Added in version 3.16.

Return type:

QgsMeshDatasetGroup.Type

defaultName(self) str[source]

Returns the default name.

Return type:

str

description(self) str[source]

Returns description about the dataset group (URI, formula,…)

Added in version 3.16.

Return type:

str

enabledDatasetGroupIndexes(self) List[int]

Returns a list of enabled dataset group indexes, included deeper children

Return type:

List[int]

Returns:

the list of dataset group indexes

Added in version 3.16.3.

groupIndexDependencies(self) List[int]

Returns a list of group index corresponding to dataset group that depends on the dataset group represented by this item

Return type:

List[int]

Returns:

list of group index

isEnabled(self) bool[source]

Returns True if the item is enabled, i.e. if it is displayed in view.

Return type:

bool

isVector(self) bool[source]

Return True if the dataset group is vector.

Return type:

bool

name(self) str[source]

Returns the name of the item This name is the default name if the name has not been overridden (setName())

Return type:

str

Returns:

the name to display

parentItem(self) QgsMeshDatasetGroupTreeItem | None[source]

Returns the parent item, None if it is root item

Return type:

Optional[QgsMeshDatasetGroupTreeItem]

Returns:

the parent item

providerName(self) str[source]

Returns the name used by the provider to identify the dataset

Return type:

str

Returns:

the provider name

Added in version 3.16.

removeChild(self, item: QgsMeshDatasetGroupTreeItem | None)[source]

Removes and destroy a item child if exists

Parameters:

item (Optional[QgsMeshDatasetGroupTreeItem]) – the item to append

Added in version 3.16.

row(self) int[source]

Returns the position of the item in the parent

Return type:

int

Returns:

tow position of the item

setDatasetGroup(self, datasetGroup: QgsMeshDatasetGroup | None)[source]

Set parameters of the item in accordance with the dataset group

Parameters:

datasetGroup (Optional[QgsMeshDatasetGroup]) – pointer to the dataset group to accord with

Added in version 3.16.

setIsEnabled(self, isEnabled: bool)[source]

Sets whether the item is enabled, that is if it is displayed in view

Parameters:

isEnabled (bool) – whether the item is enabled

setName(self, name: str | None)[source]

Overrides the default name with the name to display. The default name is still stored in the item but will not be displayed anymore except if the empty string is set.

Parameters:

name (Optional[str]) – to display

setPersistentDatasetGroup(self, uri: str | None)[source]

Set parameters of the item in accordance with the persistent dataset group with uri

Parameters:

uri (Optional[str]) – uri of the persistent dataset group

Added in version 3.16.

totalChildCount(self) int[source]

Returns the total count of children, that is included deeper children and disabled items

Return type:

int

Returns:

the total children’s count

writeXml(self, doc: QDomDocument, context: QgsReadWriteContext) QDomElement[source]

Writes the item and its children in a DOM document

Parameters:
  • doc (QDomDocument) – the DOM document

  • context (QgsReadWriteContext) – writing context (e.g. for conversion between relative and absolute paths)

Return type:

QDomElement

Returns:

the dom element where the item is written