Class: QgsBrowserTreeView¶
- class qgis.gui.QgsBrowserTreeView¶
Bases:
PyQt5.QtWidgets.QTreeView
The
QgsBrowserTreeView
class extends QTreeView with save/restore tree state functionality.See also
QgsBrowserTreeView(parent: Optional[QWidget] = None) Constructor for QgsBrowserTreeView
Methods
Returns the browser model
Expands out a file
path
in the view.- param index:
- param e:
- param event:
- param parentIndex:
Sets the browser model
- param model:
Sets the
item
currently selected in the view.- param section:
- param e:
- actionEvent(self, a0: QActionEvent | None)¶
- browserModel(self) QgsBrowserGuiModel | None ¶
Returns the browser model
- Return type:
Optional[QgsBrowserGuiModel]
- changeEvent(self, a0: QEvent | None)¶
- childEvent(self, a0: QChildEvent | None)¶
- closeEditor(self, editor: QWidget | None, hint: QAbstractItemDelegate.EndEditHint)¶
- closeEvent(self, a0: QCloseEvent | None)¶
- columnCountChanged(self, oldCount: int, newCount: int)¶
- columnMoved(self)¶
- columnResized(self, column: int, oldSize: int, newSize: int)¶
- commitData(self, editor: QWidget | None)¶
- connectNotify(self, signal: QMetaMethod)¶
- contextMenuEvent(self, a0: QContextMenuEvent | None)¶
- create(self, window: PyQt5.sip.voidptr = None, initializeWindow: bool = True, destroyOldWindow: bool = True)¶
- currentChanged(self, current: QModelIndex, previous: QModelIndex)¶
- customEvent(self, a0: QEvent | None)¶
- destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)¶
- dirtyRegionOffset(self) QPoint ¶
- disconnectNotify(self, signal: QMetaMethod)¶
- dragEnterEvent(self, e: QDragEnterEvent | None)¶
- dragLeaveEvent(self, e: QDragLeaveEvent | None)¶
- dragMoveEvent(self, event: QDragMoveEvent | None)¶
- drawBranches(self, painter: QPainter | None, rect: QRect, index: QModelIndex)¶
- drawFrame(self, a0: QPainter | None)¶
- drawRow(self, painter: QPainter | None, options: QStyleOptionViewItem, index: QModelIndex)¶
- drawTree(self, painter: QPainter | None, region: QRegion)¶
- dropEvent(self, e: QDropEvent | None)¶
- dropIndicatorPosition(self) QAbstractItemView.DropIndicatorPosition ¶
- edit(self, index: QModelIndex)¶
- edit(self, index: QModelIndex, trigger: QAbstractItemView.EditTrigger, event: QEvent | None) bool
- editorDestroyed(self, editor: QObject | None)¶
- enterEvent(self, a0: QEvent | None)¶
- event(self, event: QEvent | None) bool ¶
- eventFilter(self, object: QObject | None, event: QEvent | None) bool ¶
- executeDelayedItemsLayout(self)¶
- expandPath(self, path: str | None, selectPath: bool = False)¶
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)
- focusInEvent(self, e: QFocusEvent | None)¶
- focusNextChild(self) bool ¶
- focusNextPrevChild(self, next: bool) bool ¶
- focusOutEvent(self, e: QFocusEvent | None)¶
- focusPreviousChild(self) bool ¶
- hasExpandedDescendant(self, index: QModelIndex) bool ¶
- Parameters:
index (QModelIndex)
- Return type:
bool
- hideEvent(self, e: QHideEvent | None)¶
- Parameters:
e (Optional[QHideEvent])
- horizontalOffset(self) int ¶
- horizontalScrollbarAction(self, action: int)¶
- horizontalScrollbarValueChanged(self, value: int)¶
- indexRowSizeHint(self, index: QModelIndex) int ¶
- initPainter(self, painter: QPainter | None)¶
- initStyleOption(self, option: QStyleOptionFrame | None)¶
- inputMethodEvent(self, event: QInputMethodEvent | None)¶
- isIndexHidden(self, index: QModelIndex) bool ¶
- isSignalConnected(self, signal: QMetaMethod) bool ¶
- keyPressEvent(self, event: QKeyEvent | None)¶
- Parameters:
event (Optional[QKeyEvent])
- keyReleaseEvent(self, a0: QKeyEvent | None)¶
- leaveEvent(self, a0: QEvent | None)¶
- metric(self, a0: QPaintDevice.PaintDeviceMetric) int ¶
- mouseDoubleClickEvent(self, e: QMouseEvent | None)¶
- mouseMoveEvent(self, event: QMouseEvent | None)¶
- mousePressEvent(self, e: QMouseEvent | None)¶
- mouseReleaseEvent(self, event: QMouseEvent | None)¶
- moveCursor(self, cursorAction: QAbstractItemView.CursorAction, modifiers: Qt.KeyboardModifiers | Qt.KeyboardModifier) QModelIndex ¶
- moveEvent(self, a0: QMoveEvent | None)¶
- nativeEvent(self, eventType: QByteArray | bytes | bytearray, message: PyQt5.sip.voidptr | None)¶
- paintEvent(self, e: QPaintEvent | None)¶
- receivers(self, signal: PYQT_SIGNAL) int ¶
- reexpand(self)¶
- resizeEvent(self, e: QResizeEvent | None)¶
- rowHeight(self, index: QModelIndex) int ¶
- rowsAboutToBeRemoved(self, parent: QModelIndex, start: int, end: int)¶
- rowsInserted(self, parentIndex: QModelIndex, start: int, end: int)¶
- Parameters:
parentIndex (QModelIndex)
start (int)
end (int)
- rowsRemoved(self, parent: QModelIndex, first: int, last: int)¶
- scheduleDelayedItemsLayout(self)¶
- scrollContentsBy(self, dx: int, dy: int)¶
- scrollDirtyRegion(self, dx: int, dy: int)¶
- selectedIndexes(self) List[QModelIndex] ¶
- selectionChanged(self, selected: QItemSelection, deselected: QItemSelection)¶
- selectionCommand(self, index: QModelIndex, event: QEvent | None = None) QItemSelectionModel.SelectionFlags ¶
- sender(self) QObject | None ¶
- senderSignalIndex(self) int ¶
- setBrowserModel(self, model: QgsBrowserGuiModel | None)¶
Sets the browser model
- Parameters:
model (Optional[QgsBrowserGuiModel])
- setDirtyRegion(self, region: QRegion)¶
- setModel(self, model: QAbstractItemModel | None)¶
- Parameters:
model (Optional[QAbstractItemModel])
- setSelectedItem(self, item: QgsDataItem | None) bool ¶
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
- setSelection(self, rect: QRect, command: QItemSelectionModel.SelectionFlags | QItemSelectionModel.SelectionFlag)¶
- setSettingsSection(self, section: str | None)¶
- Parameters:
section (Optional[str])
- setState(self, state: QAbstractItemView.State)¶
- setViewportMargins(self, left: int, top: int, right: int, bottom: int)¶
- setViewportMargins(self, margins: QMargins) None
- showEvent(self, e: QShowEvent | None)¶
- Parameters:
e (Optional[QShowEvent])
- sizeHintForColumn(self, column: int) int ¶
- startDrag(self, supportedActions: Qt.DropActions | Qt.DropAction)¶
- state(self) QAbstractItemView.State ¶
- tabletEvent(self, a0: QTabletEvent | None)¶
- timerEvent(self, event: QTimerEvent | None)¶
- updateEditorData(self)¶
- updateEditorGeometries(self)¶
- updateGeometries(self)¶
- updateMicroFocus(self)¶
- verticalOffset(self) int ¶
- verticalScrollbarAction(self, action: int)¶
- verticalScrollbarValueChanged(self, value: int)¶
- viewOptions(self) QStyleOptionViewItem ¶
- viewportEvent(self, event: QEvent | None) bool ¶
- viewportMargins(self) QMargins ¶
- viewportSizeHint(self) QSize ¶
- visualRegionForSelection(self, selection: QItemSelection) QRegion ¶
- wheelEvent(self, a0: QWheelEvent | None)¶