Class: QgsMeshDatasetGroupTreeItem

class qgis.core.QgsMeshDatasetGroupTreeItem

Bases: sip.wrapper

Tree item for display of the mesh dataset groups. Dataset group is set 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

New in version 3.14.

QgsMeshDatasetGroupTreeItem() Constructor for an empty dataset group tree item

QgsMeshDatasetGroupTreeItem(defaultName: str, sourceName: str, isVector: bool, index: int) Constructor

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

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

  • isVector – whether the dataset group is a vector dataset group

  • index – index of the dataset group

QgsMeshDatasetGroupTreeItem(itemElement: QDomElement, context: QgsReadWriteContext) Constructor from a DOM element, constructs also the children

Parameters:
  • itemElement – the DOM element

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

QgsMeshDatasetGroupTreeItem(QgsMeshDatasetGroupTreeItem)

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

rtype:

int

datasetGroupType

rtype:

QgsMeshDatasetGroup.Type

defaultName

rtype:

str

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

rtype:

bool

isVector

rtype:

bool

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 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

appendChild(self, item: QgsMeshDatasetGroupTreeItem)

Appends a child item.

Note

takes ownership of item

Parameters:

item (QgsMeshDatasetGroupTreeItem) –

child(self, row: int) QgsMeshDatasetGroupTreeItem

Returns a child

Parameters:

row (int) – the position of the child

Return type:

QgsMeshDatasetGroupTreeItem

Returns:

the item at the position row

childCount(self) int

Returns the count of children

Return type:

int

Returns:

the children’s count

childFromDatasetGroupIndex(self, index: int) QgsMeshDatasetGroupTreeItem

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:

QgsMeshDatasetGroupTreeItem

Returns:

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

clone(self) QgsMeshDatasetGroupTreeItem

Clones the item

Return type:

QgsMeshDatasetGroupTreeItem

Returns:

the cloned item

datasetGroupIndex(self) int
Return type:

int

Returns:

the dataset group index

datasetGroupType(self) QgsMeshDatasetGroup.Type
Return type:

QgsMeshDatasetGroup.Type

Returns:

the dataset group type

New in version 3.16.

defaultName(self) str
Return type:

str

Returns:

the default name

description(self) str

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

New 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

New 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
Return type:

bool

Returns:

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

isVector(self) bool
Return type:

bool

Returns:

whether the dataset group is vector

name(self) str

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

Returns the parent item, None if it is root item

Return type:

QgsMeshDatasetGroupTreeItem

Returns:

the parent item

providerName(self) str

Returns the name used by the provider to identify the dataset

Return type:

str

Returns:

the provider name

New in version 3.16.

removeChild(self, item: QgsMeshDatasetGroupTreeItem)

Removes a item child if exists

Parameters:

item (QgsMeshDatasetGroupTreeItem) – the item to append

Note

takes ownership of item

New in version 3.16.

row(self) int

Returns the position of the item in the parent

Return type:

int

Returns:

tow position of the item

setDatasetGroup(self, datasetGroup: QgsMeshDatasetGroup)

Set parameters of the item in accordance with the dataset group

Parameters:

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

New in version 3.16.

setIsEnabled(self, isEnabled: bool)

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)

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 (str) – to display

setPersistentDatasetGroup(self, uri: str)

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

Parameters:

uri (str) – uri of the persistent dataset group

New in version 3.16.

totalChildCount(self) int

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

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