Class: QgsAbstractDbSourceSelect

The QgsAbstractDbSourceSelect class is a base class for database source widget selector

Added in version 3.24.

Class Hierarchy

Inheritance diagram of qgis.gui.QgsAbstractDbSourceSelect

Base classes

QgsAbstractDataSourceWidget

Abstract base Data Source Widget to create connections and add layers This class provides common functionality and the interface for all source select dialogs used by data providers to configure data sources and add layers.

QDialog

QWidget

QObject

QPaintDevice

Methods

init

Sets the source model for the table and optionally a delegate

proxyModel

Returns the proxy model used to filter the results

setSql

This is called to define the SQL query and must be re-implemented.

treeviewClicked

Called on click for the source index

treeviewDoubleClicked

Called on double-click for the source index

class qgis.gui.QgsAbstractDbSourceSelect[source]

Bases: QgsAbstractDataSourceWidget

__init__(parent: QWidget | None = None, fl: Qt.WindowFlags | Qt.WindowType = QgsGuiUtils.ModalDialogFlags, widgetMode: QgsProviderRegistry.WidgetMode = QgsProviderRegistry.WidgetMode.Standalone)

Constructor

Parameters:
  • parent (Optional[QWidget] = None)

  • fl (Union[Qt.WindowFlags, Qt.WindowType] = QgsGuiUtils.ModalDialogFlags)

  • widgetMode (QgsProviderRegistry.WidgetMode = QgsProviderRegistry.WidgetMode.Standalone)

init(self, model: QgsAbstractDbTableModel | None, delegate: QItemDelegate | None = None)[source]

Sets the source model for the table and optionally a delegate

Parameters:
proxyModel(self) QSortFilterProxyModel | None[source]

Returns the proxy model used to filter the results

Return type:

Optional[QSortFilterProxyModel]

setSql(self, index: QModelIndex)[source]

This is called to define the SQL query and must be re-implemented. The implementation should call QgsAbstractDbTableModel.setSql The index is in the source model.

Parameters:

index (QModelIndex)

treeviewClicked(self, index: QModelIndex)[source]

Called on click for the source index

Parameters:

index (QModelIndex)

treeviewDoubleClicked(self, index: QModelIndex)[source]

Called on double-click for the source index

Parameters:

index (QModelIndex)