Class: QgsBrowserDockWidget

A dock widget containing a QgsBrowserWidget for navigating and managing data sources.

Class Hierarchy

Inheritance diagram of qgis.gui.QgsBrowserDockWidget

Base classes

QgsDockWidget

A QDockWidget subclass with more fine-grained control over how the widget is closed or opened.

QDockWidget

QWidget

QObject

QPaintDevice

class qgis.gui.QgsBrowserDockWidget[source]

Bases: QgsDockWidget

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

Constructor for QgsBrowserDockWidget

Parameters:
  • name (Optional[str]) – name of the widget

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

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

addFavorite(self)[source]

Add current item to favorite.

Deprecated since version 3.40: Will be removed in QGIS 4.0 - use the methods in QgsBrowserModel instead.

addFavoriteDirectory(self, favDir: str | None, name: str | None = '')[source]

Add directory to favorites.

Deprecated since version 3.40: Will be removed in QGIS 4.0 - use the methods in QgsBrowserModel instead.

addFavoriteDirectory(self) Add directory from file dialog to favorite.

Deprecated since version 3.40: Will be removed in QGIS 4.0 - use the methods in QgsBrowserModel instead.

Parameters:
  • favDir (Optional[str])

  • name (Optional[str] = '')

addLayerAtIndex(self, index: QModelIndex) bool[source]

Adds the layer corresponding to the specified model index.

Returns True if the index was successfully intrepreted as a map layer and loaded, or False if the index is not a map layer or could not be loaded.

Deprecated since version 3.40: Will be removed in QGIS 4.0 - retrieve the QgsLayerItem itself and manually add to project.

Parameters:

index (QModelIndex)

Return type:

bool

addSelectedLayers(self)[source]

Add selected layers to the project

Deprecated since version 3.40: Will be removed in QGIS 4.0 – this method is not intended for public use.

browserWidget(self) QgsBrowserWidget | None[source]

Returns a pointer to the QgsBrowserWidget used by the dock widget.

Added in version 3.22.

Return type:

Optional[QgsBrowserWidget]

signal connectionsChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

enablePropertiesWidget(self, enable: bool)[source]

Enable/disable properties widget.

Deprecated since version 3.40: Will be removed in QGIS 4.0 – this method is not intended for public use.

Parameters:

enable (bool)

signal handleDropUriList[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

hideItem(self)[source]

Hide current item.

Deprecated since version 3.40: Will be removed in QGIS 4.0 – this method is not intended for public use.

mapCanvas(self) QgsMapCanvas | None[source]

Returns the map canvas associated with the dock.

See also

setMapCanvas()

Added in version 3.44.

Return type:

Optional[QgsMapCanvas]

messageBar(self) QgsMessageBar | None[source]

Returns the message bar associated with the dock.

See also

setMessageBar()

Added in version 3.6.

Return type:

Optional[QgsMessageBar]

signal openFile[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

refresh(self)[source]

Refresh the browser model and view.

removeFavorite(self)[source]

Remove from favorite.

Deprecated since version 3.40: Will be removed in QGIS 4.0 - use the methods in QgsBrowserModel instead.

selectionChanged(self, selected: QItemSelection, deselected: QItemSelection)[source]

Selection has changed.

Deprecated since version 3.40: Will be removed in QGIS 4.0 – this method is not intended for public use.

Parameters:
  • selected (QItemSelection)

  • deselected (QItemSelection)

setActiveIndex(self, index: QModelIndex)[source]

Sets the selection to index and expand it.

Deprecated since version 3.40: Will be removed in QGIS 4.0 – this method is not intended for public use.

Parameters:

index (QModelIndex)

setCaseSensitive(self, caseSensitive: bool)[source]

Sets filter case sensitivity.

Deprecated since version 3.40: Will be removed in QGIS 4.0 – this method is not intended for public use.

Parameters:

caseSensitive (bool)

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

Added in version 3.12.

Parameters:

filter (Iterable[Optional[str]])

setFilter(self)[source]

Apply filter to the model.

Deprecated since version 3.40: Will be removed in QGIS 4.0 – this method is not intended for public use.

setFilterSyntax(self, a0: QAction | None)[source]

Sets filter syntax.

Deprecated since version 3.40: Will be removed in QGIS 4.0 – this method is not intended for public use.

Parameters:

a0 (Optional[QAction])

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

Sets a map canvas to use alongside the dock.

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 dock 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()

Added in version 3.6.

Parameters:

bar (Optional[QgsMessageBar])

showContextMenu(self, a0: QPoint)[source]

Show context menu.

Deprecated since version 3.40: Will be removed in QGIS 4.0 – this method is not intended for public use.

Parameters:

a0 (QPoint)

showFilterWidget(self, visible: bool)[source]

Show/hide filter widget.

Deprecated since version 3.40: Will be removed in QGIS 4.0 – this method is not intended for public use.

Parameters:

visible (bool)

showProperties(self)[source]

Show the layer properties.

Deprecated since version 3.40: Will be removed in QGIS 4.0 – this method is not intended for public use.

splitterMoved(self)[source]

Splitter has been moved.

Deprecated since version 3.40: No longer used.

toggleFastScan(self)[source]

Toggle fast scan

Deprecated since version 3.40: Will be removed in QGIS 4.0.

updateProjectHome(self)[source]

Update project home directory.

Deprecated since version 3.40: Will be removed in QGIS 4.0 – this method is not intended for public use.