Class: QgsSourceSelectProviderRegistry

A registry for QgsSourceSelectProvider source select providers.

This class keeps a list of source select providers that may add items to the QgsDataSourceManagerDialog When created, it automatically adds providers from data provider plugins (e.g. PostGIS, WMS, …)

QgsSourceSelectProviderRegistry is not usually directly created, but rather accessed through QgsGui.sourceSelectProviderRegistry().

Class Hierarchy

Inheritance diagram of qgis.gui.QgsSourceSelectProviderRegistry

Base classes

QObject

class qgis.gui.QgsSourceSelectProviderRegistry[source]

Bases: QObject

addProvider(self, provider: QgsSourceSelectProvider | None)[source]

Add a provider implementation. Takes ownership of the object.

Parameters:

provider (Optional[QgsSourceSelectProvider])

createSelectionWidget(self, name: str | None, parent: QWidget | None, fl: Qt.WindowFlags | Qt.WindowType, widgetMode: QgsProviderRegistry.WidgetMode) QgsAbstractDataSourceWidget | None[source]

Gets select widget from provider with name

The function is replacement of QgsProviderRegistry.createSelectionWidget() from QGIS 3.8

Added in version 3.10.

Parameters:
Return type:

Optional[QgsAbstractDataSourceWidget]

initializeFromProviderGuiRegistry(self, providerGuiRegistry: QgsProviderGuiRegistry | None)[source]

Initializes the registry. The registry needs to be passed explicitly (instead of using singleton) because this gets called from QgsGui constructor.

Added in version 3.10.

Parameters:

providerGuiRegistry (Optional[QgsProviderGuiRegistry])

signal providerAdded[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.

providerByName(self, name: str | None) QgsSourceSelectProvider | None[source]

Returns a provider by name or None if not found

Parameters:

name (Optional[str])

Return type:

Optional[QgsSourceSelectProvider]

signal providerRemoved[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.

providers(self) List[QgsSourceSelectProvider]

Gets list of available providers

Return type:

List[QgsSourceSelectProvider]

providersByKey(self, providerKey: str | None) List[QgsSourceSelectProvider]

Returns a (possibly empty) list of providers by data providerkey

Parameters:

providerKey (Optional[str])

Return type:

List[QgsSourceSelectProvider]

removeProvider(self, provider: QgsSourceSelectProvider | None) bool[source]

Remove provider implementation from the list (provider object is deleted)

Return type:

bool

Returns:

True if the provider was actually removed and deleted

Parameters:

provider (Optional[QgsSourceSelectProvider])