Class: QgsSourceSelectProviderRegistry

class qgis.gui.QgsSourceSelectProviderRegistry

Bases: sip.wrapper

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()

Methods

addProvider

Add a provider implementation.

createSelectionWidget

Gets select widget from provider with name

initializeFromProviderGuiRegistry

Initializes the registry.

providerByName

Returns a provider by name or None if not found

providers

Gets list of available providers

providersByKey

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

removeProvider

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

addProvider(self, provider: QgsSourceSelectProvider)

Add a provider implementation. Takes ownership of the object.

Parameters

provider (QgsSourceSelectProvider) –

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

Gets select widget from provider with name

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

New in version 3.10.

Parameters
Return type

QgsAbstractDataSourceWidget

initializeFromProviderGuiRegistry(self, providerGuiRegistry: QgsProviderGuiRegistry)

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

New in version 3.10.

Parameters

providerGuiRegistry (QgsProviderGuiRegistry) –

providerByName(self, name: str) → QgsSourceSelectProvider

Returns a provider by name or None if not found

Parameters

name (str) –

Return type

QgsSourceSelectProvider

providers(self) → List[QgsSourceSelectProvider]

Gets list of available providers

Return type

List[QgsSourceSelectProvider]

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

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

Parameters

providerKey (str) –

Return type

List[QgsSourceSelectProvider]

removeProvider(self, provider: QgsSourceSelectProvider) → bool

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 (QgsSourceSelectProvider) –