Class: QgsBrowserWidget

A widget showing a browser tree view along with toolbar and toggleable properties pane.

Added in version 3.22.

Class Hierarchy

Inheritance diagram of qgis.gui.QgsBrowserWidget

Base classes

QgsPanelWidget

Base class for any widget that can be shown as a inline panel

QWidget

QObject

QPaintDevice

Methods

messageBar

Returns the message bar associated with the widget.

refresh

Refreshes the browser model and view.

setDisabledDataItemsKeys

Sets the customization for data items based on item's data provider key

setMessageBar

Sets a message bar to use alongside the widget.

class qgis.gui.QgsBrowserWidget[source]

Bases: QgsPanelWidget

__init__(browserModel: QgsBrowserGuiModel | None, parent: QWidget | None = None)

Constructor for QgsBrowserWidget

Parameters:
  • browserModel (Optional[QgsBrowserGuiModel]) – instance of the (shared) browser model

  • parent (Optional[QWidget] = None) – parent widget

messageBar(self) QgsMessageBar | None[source]

Returns the message bar associated with the widget.

See also

setMessageBar()

Return type:

Optional[QgsMessageBar]

refresh(self)[source]

Refreshes the browser model and view.

setDisabledDataItemsKeys(self, filter: Iterable[str | None])[source]

Sets the customization for data items based on item’s data provider key

By default browser model shows all items from all available data items provider and few special items (e.g. Favorites). To customize the behavior, set the filter to not load certain data items. The items that are not based on data item providers (e.g. Favorites, Home) have prefix “special:”

Used in the proxy browser model to hide items

Parameters:

filter (Iterable[Optional[str]])

setMessageBar(self, bar: QgsMessageBar | None)[source]

Sets a message bar to use alongside the widget. Setting this allows items to utilize the message bar to provide non-blocking feedback to users, e.g. success or failure of actions.

See also

messageBar()

Parameters:

bar (Optional[QgsMessageBar])