Class: QgsMeshDatasetGroupTreeItem¶
-
class
qgis.core.
QgsMeshDatasetGroupTreeItem
¶ Bases:
sip.wrapper
Constructor for an empty dataset group tree item
QgsMeshDatasetGroupTreeItem(defaultName: str, isVector: bool, index: int) Constructor
- Parameters
defaultName – the name that will be used to display the item if iot not overrides (
setName()
)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, contruct 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
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
str
- rtype
bool
- rtype
bool
Returns the name of the item This mame is the default name if the name has not been overrided (
setName()
)Returns the parent item, None if it is root item
Returns the position of the item in the parent
Sets whether the item is enabled, that is if it is displayed in view
Overrides the default name with the name to display.
Returns the total count of children, that is included deeper children
Write 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 positon
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
-
defaultName
(self) → str¶ - Return type
str
- Returns
the default name
-
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 mame is the default name if the name has not been overrided (
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
-
row
(self) → int¶ Returns the position of the item in the parent
- Return type
int
- Returns
tow position of the item
-
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 setted.
- Parameters
name (str) – to display
-
totalChildCount
(self) → int¶ Returns the total count of children, that is included deeper children
- Return type
int
- Returns
-
writeXml
(self, doc: QDomDocument, context: QgsReadWriteContext) → QDomElement¶ Write 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