Class: QgsMeshDatasetGroupTreeItem¶
- class qgis.core.QgsMeshDatasetGroupTreeItem¶
Bases:
sip.wrapper
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
)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:
Methods
Appends a item child
Returns a child
Returns the count of children
Returns the child with dataset group
index
Searches as depper as needed on the child hierarchyClones the item
- rtype
int
- rtype
QgsMeshDatasetGroup.Type
- rtype
str
Returns description about the dataset group (URI, formula,...)
Returns a list of enabled dataset group indexes, included deeper children
Returns a list of group index corresponding to dataset group that depends on the dataset group represented by this item
- rtype
bool
- rtype
bool
Returns the name of the item This name is the default name if the name has not been overridden (
setName()
)Returns the parent item, None if it is root item
Returns the name used by the provider to identify the dataset
Removes a item child if exists
Returns the position of the item in the parent
Set parameters of the item in accordance with the dataset group
Sets whether the item is enabled, that is if it is displayed in view
Overrides the default name with the name to display.
Set parameters of the item in accordance with the persistent dataset group with
uri
Returns the total count of children, that is included deeper children and disabled items
Writes the item and its children in a DOM document
- appendChild(self, item: QgsMeshDatasetGroupTreeItem)¶
Appends a item child
- Parameters
item (QgsMeshDatasetGroupTreeItem) – the item to append
Note
takes ownership of item
- child(self, row: int) QgsMeshDatasetGroupTreeItem ¶
Returns a child
- Parameters
row (int) – the position of the child
- Return type
- 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
- Returns
the item with index as dataset group index, None if no item is found
- clone(self) QgsMeshDatasetGroupTreeItem ¶
Clones the item
- Return type
- Returns
the cloned item
- datasetGroupIndex(self) int ¶
- Return type
int
- Returns
the dataset group index
- datasetGroupType(self) QgsMeshDatasetGroup.Type ¶
- Return 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
- 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