Class: QgsBrowserTreeView¶
The QgsBrowserTreeView
class extends QTreeView with
save/restore tree state functionality.
See also
Class Hierarchy¶
Base classes¶
Methods
Returns the browser model |
|
Expands out a file path in the view. |
|
Sets the browser model |
|
Sets the item currently selected in the view. |
|
- class qgis.gui.QgsBrowserTreeView[source]¶
Bases:
QTreeView
- __init__(parent: QWidget | None = None)
Constructor for QgsBrowserTreeView
- Parameters:
parent (Optional[QWidget] = None)
- browserModel(self) QgsBrowserGuiModel | None [source]¶
Returns the browser model
- Return type:
Optional[QgsBrowserGuiModel]
- expandPath(self, path: str | None, selectPath: bool = False)[source]¶
Expands out a file
path
in the view.The
path
must correspond to a valid directory existing on the file system.Since QGIS 3.38 the
selectPath
argument can be used to automatically select the path too.Added in version 3.28.
- Parameters:
path (Optional[str])
selectPath (bool = False)
- hasExpandedDescendant(self, index: QModelIndex) bool [source]¶
- Parameters:
index (QModelIndex)
- Return type:
bool
- setBrowserModel(self, model: QgsBrowserGuiModel | None)[source]¶
Sets the browser model
- Parameters:
model (Optional[QgsBrowserGuiModel])
- setSelectedItem(self, item: QgsDataItem | None) bool [source]¶
Sets the
item
currently selected in the view.Returns
True
if the item was found and could be selected.Added in version 3.28.
- Parameters:
item (Optional[QgsDataItem])
- Return type:
bool