Class: QgsDataSourceSelectDialog¶
- class qgis.gui.QgsDataSourceSelectDialog¶
Bases:
PyQt5.QtWidgets.QDialog
The
QgsDataSourceSelectDialog
class embeds the browser view to select an existing data source.By default any layer type can be chosen, the valid layer type can be restricted by setting a layer type filter with setLayerTypeFilter(layerType) or by activating the filter directly from the constructor.
To retrieve the selected data source,
uri()
can be called and it will return a (possibly invalid)QgsMimeDataUtils
.Uri.Added in version 3.6.
QgsDataSourceSelectDialog(browserModel: Optional[QgsBrowserGuiModel] = None, setFilterByLayerType: bool = False, layerType: Qgis.LayerType = Qgis.LayerType.Vector, parent: Optional[QWidget] = None) Constructs a
QgsDataSourceSelectDialog
, optionally filtering by layer type- Parameters:
browserModel – an existing browser model (typically from app), if
None
an instance will be createdsetFilterByLayerType – activates filtering by layer type
layerType – sets the layer type filter, this is in effect only if filtering by layer type is also active
parent –
the object
Methods
Expands out a file
path
in the view.Sets filter case sensitivity
Sets a description label
Apply filter to the model
Sets filter syntax
Sets layer type filter to
layerType
and activates the filteringShow/hide filter widget
Returns the (possibly invalid) uri of the selected data source
- actionEvent(self, a0: QActionEvent | None)¶
- changeEvent(self, a0: QEvent | None)¶
- childEvent(self, a0: QChildEvent | None)¶
- closeEvent(self, a0: QCloseEvent | None)¶
- connectNotify(self, signal: QMetaMethod)¶
- contextMenuEvent(self, a0: QContextMenuEvent | None)¶
- create(self, window: PyQt5.sip.voidptr = None, initializeWindow: bool = True, destroyOldWindow: bool = True)¶
- customEvent(self, a0: QEvent | None)¶
- destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)¶
- disconnectNotify(self, signal: QMetaMethod)¶
- dragEnterEvent(self, a0: QDragEnterEvent | None)¶
- dragLeaveEvent(self, a0: QDragLeaveEvent | None)¶
- dragMoveEvent(self, a0: QDragMoveEvent | None)¶
- dropEvent(self, a0: QDropEvent | None)¶
- enterEvent(self, a0: QEvent | None)¶
- event(self, a0: QEvent | None) bool ¶
- eventFilter(self, a0: QObject | None, a1: QEvent | None) bool ¶
- expandPath(self, path: str | None)¶
Expands out a file
path
in the view.The
path
must correspond to a valid directory existing on the file system.Added in version 3.28.
- Parameters:
path (Optional[str])
- focusInEvent(self, a0: QFocusEvent | None)¶
- focusNextChild(self) bool ¶
- focusNextPrevChild(self, next: bool) bool ¶
- focusOutEvent(self, a0: QFocusEvent | None)¶
- focusPreviousChild(self) bool ¶
- hideEvent(self, a0: QHideEvent | None)¶
- initPainter(self, painter: QPainter | None)¶
- inputMethodEvent(self, a0: QInputMethodEvent | None)¶
- isSignalConnected(self, signal: QMetaMethod) bool ¶
- keyPressEvent(self, a0: QKeyEvent | None)¶
- keyReleaseEvent(self, a0: QKeyEvent | None)¶
- leaveEvent(self, a0: QEvent | None)¶
- metric(self, a0: QPaintDevice.PaintDeviceMetric) int ¶
- mouseDoubleClickEvent(self, a0: QMouseEvent | None)¶
- mouseMoveEvent(self, a0: QMouseEvent | None)¶
- mousePressEvent(self, a0: QMouseEvent | None)¶
- mouseReleaseEvent(self, a0: QMouseEvent | None)¶
- moveEvent(self, a0: QMoveEvent | None)¶
- nativeEvent(self, eventType: QByteArray | bytes | bytearray, message: PyQt5.sip.voidptr | None)¶
- paintEvent(self, a0: QPaintEvent | None)¶
- receivers(self, signal: PYQT_SIGNAL) int ¶
- resizeEvent(self, a0: QResizeEvent | None)¶
- sender(self) QObject | None ¶
- senderSignalIndex(self) int ¶
- setCaseSensitive(self, caseSensitive: bool)¶
Sets filter case sensitivity
- Parameters:
caseSensitive (bool)
- setDescription(self, description: str | None)¶
Sets a description label
- Parameters:
description (Optional[str]) – a description string
Note
the description will be displayed at the bottom of the dialog
Added in version 3.8.
- setFilter(self)¶
Apply filter to the model
- setFilterSyntax(self, a0: QAction | None)¶
Sets filter syntax
- Parameters:
a0 (Optional[QAction])
- setLayerTypeFilter(self, layerType: Qgis.LayerType)¶
Sets layer type filter to
layerType
and activates the filtering- Parameters:
layerType (Qgis.LayerType)
- showEvent(self, a0: QShowEvent | None)¶
- showFilterWidget(self, visible: bool)¶
Show/hide filter widget
- Parameters:
visible (bool)
- tabletEvent(self, a0: QTabletEvent | None)¶
- timerEvent(self, a0: QTimerEvent | None)¶
- updateMicroFocus(self)¶
- uri(self) QgsMimeDataUtils.Uri ¶
Returns the (possibly invalid) uri of the selected data source
- Return type:
- wheelEvent(self, a0: QWheelEvent | None)¶