Class: QgsBrowserDockWidget¶
A dock widget containing a QgsBrowserWidget
for navigating
and managing data sources.
Class Hierarchy¶
Base classes¶
A QDockWidget subclass with more fine-grained control over how the widget is closed or opened. |
|
Methods
Add current item to favorite. |
|
Add directory to favorites. |
|
Adds the layer corresponding to the specified model index. |
|
Add selected layers to the project |
|
Returns a pointer to the |
|
Enable/disable properties widget. |
|
Hide current item. |
|
Returns the map canvas associated with the dock. |
|
Returns the message bar associated with the dock. |
|
Refresh the browser model and view. |
|
Remove from favorite. |
|
Selection has changed. |
|
Sets the selection to index and expand it. |
|
Sets filter case sensitivity. |
|
Sets the customization for data items based on item's data provider key |
|
Apply filter to the model. |
|
Sets filter syntax. |
|
Sets a map canvas to use alongside the dock. |
|
Sets a message bar to use alongside the dock widget. |
|
Show context menu. |
|
Show/hide filter widget. |
|
Show the layer properties. |
|
Splitter has been moved. |
|
Toggle fast scan |
|
Update project home directory. |
Signals
Connections changed in the browser |
|
Emitted when drop uri list needs to be handled |
|
Emitted when a file needs to be opened |
- 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.- Parameters:
favDir (Optional[str])
name (Optional[str] = '')
- addFavoriteDirectory(self)[source]
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.
- 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, orFalse
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]
- 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(uris: QgsMimeDataUtils.UriList)[source]¶
Emitted when drop uri list needs to be handled
- Parameters:
uris (QgsMimeDataUtils.UriList)
- 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
Added in version 3.44.
- Return type:
Optional[QgsMapCanvas]
- messageBar(self) QgsMessageBar | None [source]¶
Returns the message bar associated with the dock.
See also
Added in version 3.6.
- Return type:
Optional[QgsMessageBar]
- signal openFile(fileName: str, fileTypeHint: str | None = None)[source]¶
Emitted when a file needs to be opened
- Parameters:
fileName (str)
fileTypeHint (Optional[str] = None)
- 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
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
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.