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 an inline panel.

QWidget

QObject

QPaintDevice

Methods

mapCanvas

Returns the map canvas associated with the widget.

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

setMapCanvas

Sets a map canvas to use alongside the widget.

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

mapCanvas(self) QgsMapCanvas | None[source]

Returns the map canvas associated with the widget.

See also

setMapCanvas()

Added in version 3.44.

Return type:

Optional[QgsMapCanvas]

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]])

setMapCanvas(self, canvas: QgsMapCanvas | None)[source]

Sets a map canvas to use alongside the widget.

Setting this allows items to utilize the canvas during GUI operations.

See also

mapCanvas()

Added in version 3.44.

Parameters:

canvas (Optional[QgsMapCanvas])

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])