Class: QgsBrowserDockWidget¶
- class qgis.gui.QgsBrowserDockWidget¶
Bases:
QgsDockWidget
A dock widget containing a
QgsBrowserWidget
for navigating and managing data sources.New in version 3.0.
QgsBrowserDockWidget(name: str, browserModel:
QgsBrowserGuiModel
, parent: QWidget = None) Constructor for QgsBrowserDockWidget- Parameters:
name – name of the widget
browserModel – instance of the (shared) browser model
parent –
parent widget
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
QgsBrowserWidget
used by the dock widget.Enable/disable properties widget.
Hide current item.
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 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
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
- actionEvent(self, QActionEvent)¶
- addFavorite(self)¶
Add current item to favorite.
Deprecated since version will: be removed in QGIS 4.0 - use the methods in
QgsBrowserModel
instead
- addFavoriteDirectory(self, favDir: str, name: str = '')¶
Add directory to favorites.
Deprecated since version will: be removed in QGIS 4.0 - use the methods in
QgsBrowserModel
insteadaddFavoriteDirectory(self) Add directory from file dialog to favorite.
Deprecated since version will: be removed in QGIS 4.0 - use the methods in
QgsBrowserModel
instead- Parameters:
favDir (str) –
name (str = '') –
- addLayerAtIndex(self, index: QModelIndex) bool ¶
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 will: be removed in QGIS 4.0 - retrieve the
QgsLayerItem
itself and manually add to project.- Parameters:
index (QModelIndex) –
- Return type:
bool
- addSelectedLayers(self)¶
Add selected layers to the project
Deprecated since version will: be removed in QGIS 4.0 – this method is not intended for public use
- browserWidget(self) QgsBrowserWidget ¶
Returns a pointer to the
QgsBrowserWidget
used by the dock widget.New in version 3.22.
- Return type:
- changeEvent(self, QEvent)¶
- childEvent(self, QChildEvent)¶
- closeEvent(self, QCloseEvent)¶
- connectNotify(self, QMetaMethod)¶
- connectionsChanged¶
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.
- Parameters:
name (str = ...) –
revision (int = ...) –
arguments (Sequence = ...) –
- Return type:
PYQT_SIGNAL
- contextMenuEvent(self, QContextMenuEvent)¶
- create(self, window: PyQt5.sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)¶
- customEvent(self, QEvent)¶
- destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)¶
- disconnectNotify(self, QMetaMethod)¶
- dragEnterEvent(self, QDragEnterEvent)¶
- dragLeaveEvent(self, QDragLeaveEvent)¶
- dragMoveEvent(self, QDragMoveEvent)¶
- dropEvent(self, QDropEvent)¶
- enablePropertiesWidget(self, enable: bool)¶
Enable/disable properties widget.
Deprecated since version will: be removed in QGIS 4.0 – this method is not intended for public use
- Parameters:
enable (bool) –
- enterEvent(self, QEvent)¶
- event(self, QEvent) bool ¶
- focusInEvent(self, QFocusEvent)¶
- focusNextChild(self) bool ¶
- focusNextPrevChild(self, bool) bool ¶
- focusOutEvent(self, QFocusEvent)¶
- focusPreviousChild(self) bool ¶
- handleDropUriList¶
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.
- Parameters:
name (str = ...) –
revision (int = ...) –
arguments (Sequence = ...) –
- Return type:
PYQT_SIGNAL
- hideEvent(self, QHideEvent)¶
- hideItem(self)¶
Hide current item.
Deprecated since version will: be removed in QGIS 4.0 – this method is not intended for public use
- initPainter(self, QPainter)¶
- initStyleOption(self, QStyleOptionDockWidget)¶
- inputMethodEvent(self, QInputMethodEvent)¶
- isSignalConnected(self, QMetaMethod) bool ¶
- keyPressEvent(self, QKeyEvent)¶
- keyReleaseEvent(self, QKeyEvent)¶
- leaveEvent(self, QEvent)¶
- messageBar(self) QgsMessageBar ¶
Returns the message bar associated with the dock.
See also
New in version 3.6.
- Return type:
- metric(self, QPaintDevice.PaintDeviceMetric) int ¶
- mouseDoubleClickEvent(self, QMouseEvent)¶
- mouseMoveEvent(self, QMouseEvent)¶
- mousePressEvent(self, QMouseEvent)¶
- mouseReleaseEvent(self, QMouseEvent)¶
- moveEvent(self, QMoveEvent)¶
- nativeEvent(self, Union[QByteArray, bytes, bytearray], PyQt5.sip.voidptr) Tuple[bool, int] ¶
- openFile¶
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.
- Parameters:
name (str = ...) –
revision (int = ...) –
arguments (Sequence = ...) –
- Return type:
PYQT_SIGNAL
- paintEvent(self, QPaintEvent)¶
- receivers(self, PYQT_SIGNAL) int ¶
- refresh(self)¶
Refresh the browser model and view.
- removeFavorite(self)¶
Remove from favorite.
Deprecated since version will: be removed in QGIS 4.0 - use the methods in
QgsBrowserModel
instead
- resizeEvent(self, QResizeEvent)¶
- selectionChanged(self, selected: QItemSelection, deselected: QItemSelection)¶
Selection has changed.
Deprecated since version will: be removed in QGIS 4.0 – this method is not intended for public use
- Parameters:
selected (QItemSelection) –
deselected (QItemSelection) –
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setActiveIndex(self, index: QModelIndex)¶
Sets the selection to
index
and expand it.Deprecated since version will: be removed in QGIS 4.0 – this method is not intended for public use
- Parameters:
index (QModelIndex) –
- setCaseSensitive(self, caseSensitive: bool)¶
Sets filter case sensitivity.
Deprecated since version will: be removed in QGIS 4.0 – this method is not intended for public use
- Parameters:
caseSensitive (bool) –
- setDisabledDataItemsKeys(self, filter: Iterable[str])¶
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
New in version 3.12.
- Parameters:
filter (Iterable[str]) –
- setFilter(self)¶
Apply filter to the model.
Deprecated since version will: be removed in QGIS 4.0 – this method is not intended for public use
- setFilterSyntax(self, QAction)¶
Sets filter syntax.
Deprecated since version will: be removed in QGIS 4.0 – this method is not intended for public use
- setMessageBar(self, bar: QgsMessageBar)¶
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
New in version 3.6.
- Parameters:
bar (QgsMessageBar) –
- showContextMenu(self, QPoint)¶
Show context menu.
Deprecated since version will: be removed in QGIS 4.0 – this method is not intended for public use
- showEvent(self, event: QShowEvent)¶
- showFilterWidget(self, visible: bool)¶
Show/hide filter widget.
Deprecated since version will: be removed in QGIS 4.0 – this method is not intended for public use
- Parameters:
visible (bool) –
- showProperties(self)¶
Show the layer properties.
Deprecated since version will: be removed in QGIS 4.0 – this method is not intended for public use
- splitterMoved(self)¶
Splitter has been moved.
Deprecated since version no: longer used.
- tabletEvent(self, QTabletEvent)¶
- timerEvent(self, QTimerEvent)¶
- toggleFastScan(self)¶
Toggle fast scan
Deprecated since version will: be removed in QGIS 4.0
- updateMicroFocus(self)¶
- updateProjectHome(self)¶
Update project home directory.
Deprecated since version will: be removed in QGIS 4.0 – this method is not intended for public use
- wheelEvent(self, QWheelEvent)¶