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¶
Base classes¶
- class qgis.gui.QgsSourceSelectProviderRegistry[source]¶
Bases:
QObject- addProvider(self, provider: QgsSourceSelectProvider | None)[source]¶
Add a
providerimplementation. 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
nameThe function is replacement of
QgsProviderRegistry.createSelectionWidget()from QGIS 3.8Added in version 3.10.
- Parameters:
name (Optional[str])
parent (Optional[QWidget])
fl (Union[Qt.WindowFlags, Qt.WindowType])
widgetMode (QgsProviderRegistry.WidgetMode)
- 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
QgsGuiconstructor.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
nameorNoneif 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:
- providersByKey(self, providerKey: str | None) List[QgsSourceSelectProvider]¶
Returns a (possibly empty) list of providers by data
providerkey- Parameters:
providerKey (Optional[str])
- Return type:
- removeProvider(self, provider: QgsSourceSelectProvider | None) bool[source]¶
Remove
providerimplementation from the list (providerobject is deleted)- Return type:
bool
- Returns:
Trueif the provider was actually removed and deleted- Parameters:
provider (Optional[QgsSourceSelectProvider])