QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
QgsBrowserTreeView Class Reference

Extends QTreeView with save/restore tree state and other browser-specific functionality. More...

#include <qgsbrowsertreeview.h>

Inheritance diagram for QgsBrowserTreeView:

Public Member Functions

 QgsBrowserTreeView (QWidget *parent=nullptr)
 Constructor for QgsBrowserTreeView.
QgsBrowserGuiModelbrowserModel ()
 Returns the browser model.
void expandPath (const QString &path, bool selectPath=false)
 Expands out a file path in the view.
bool hasExpandedDescendant (const QModelIndex &index) const
void hideEvent (QHideEvent *e) override
void setBrowserModel (QgsBrowserGuiModel *model)
 Sets the browser model.
void setModel (QAbstractItemModel *model) override
bool setSelectedItem (QgsDataItem *item)
 Sets the item currently selected in the view.
void setSettingsSection (const QString &section)
void showEvent (QShowEvent *e) override

Protected Slots

void rowsInserted (const QModelIndex &parentIndex, int start, int end) override

Protected Member Functions

void keyPressEvent (QKeyEvent *event) override

Detailed Description

Extends QTreeView with save/restore tree state and other browser-specific functionality.

See also
QgsBrowserModel

Definition at line 40 of file qgsbrowsertreeview.h.

Constructor & Destructor Documentation

◆ QgsBrowserTreeView()

QgsBrowserTreeView::QgsBrowserTreeView ( QWidget * parent = nullptr)

Constructor for QgsBrowserTreeView.

Definition at line 35 of file qgsbrowsertreeview.cpp.

Member Function Documentation

◆ browserModel()

QgsBrowserGuiModel * QgsBrowserTreeView::browserModel ( )
inline

Returns the browser model.

Definition at line 60 of file qgsbrowsertreeview.h.

◆ expandPath()

void QgsBrowserTreeView::expandPath ( const QString & path,
bool selectPath = 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.

Since
QGIS 3.28

Definition at line 182 of file qgsbrowsertreeview.cpp.

◆ hasExpandedDescendant()

bool QgsBrowserTreeView::hasExpandedDescendant ( const QModelIndex & index) const

Definition at line 165 of file qgsbrowsertreeview.cpp.

◆ hideEvent()

void QgsBrowserTreeView::hideEvent ( QHideEvent * e)
override

Definition at line 72 of file qgsbrowsertreeview.cpp.

◆ keyPressEvent()

void QgsBrowserTreeView::keyPressEvent ( QKeyEvent * event)
overrideprotected

Definition at line 43 of file qgsbrowsertreeview.cpp.

◆ rowsInserted

void QgsBrowserTreeView::rowsInserted ( const QModelIndex & parentIndex,
int start,
int end )
overrideprotectedslot

Definition at line 329 of file qgsbrowsertreeview.cpp.

◆ setBrowserModel()

void QgsBrowserTreeView::setBrowserModel ( QgsBrowserGuiModel * model)

Sets the browser model.

Definition at line 58 of file qgsbrowsertreeview.cpp.

◆ setModel()

void QgsBrowserTreeView::setModel ( QAbstractItemModel * model)
override

Definition at line 51 of file qgsbrowsertreeview.cpp.

◆ setSelectedItem()

bool QgsBrowserTreeView::setSelectedItem ( QgsDataItem * item)

Sets the item currently selected in the view.

Returns true if the item was found and could be selected.

Since
QGIS 3.28

Definition at line 310 of file qgsbrowsertreeview.cpp.

◆ setSettingsSection()

void QgsBrowserTreeView::setSettingsSection ( const QString & section)
inline

Definition at line 68 of file qgsbrowsertreeview.h.

◆ showEvent()

void QgsBrowserTreeView::showEvent ( QShowEvent * e)
override

Definition at line 63 of file qgsbrowsertreeview.cpp.


The documentation for this class was generated from the following files: