Class: QgsProviderSourceWidgetProvider

An interface for providers of widgets designed to configure a data provider’s source.

Added in version 3.18.

Note

This is an abstract class, with methods which must be implemented by a subclass.

The following methods must be implemented: canHandleLayer(), createWidget(), providerKey()

Abstract Methods

canHandleLayer

Returns True if the provider can handle the specified layer.

createWidget

Creates a new widget to configure the source of the specified layer.

providerKey

Provider key

Virtual Methods

In PyQGIS, only methods marked as virtual can be safely overridden in a Python subclass of QgsProviderSourceWidgetProvider. See the FAQ for more details.

name

Source widget provider name, this is useful to retrieve a particular source widget provider in case the provider has more than one, it should be unique among all providers.

class qgis.gui.QgsProviderSourceWidgetProvider[source]

Bases: object

abstract canHandleLayer(self, layer: QgsMapLayer | None) bool[source]

Returns True if the provider can handle the specified layer.

Parameters:

layer (Optional[QgsMapLayer])

Return type:

bool

abstract createWidget(self, layer: QgsMapLayer | None, parent: QWidget | None = None) QgsProviderSourceWidget | None[source]

Creates a new widget to configure the source of the specified layer. It may return None if it cannot handle the layer. The returned object must be destroyed by the caller.

Parameters:
  • layer (Optional[QgsMapLayer])

  • parent (Optional[QWidget] = None)

Return type:

Optional[QgsProviderSourceWidget]

virtual name(self) str[source]

Source widget provider name, this is useful to retrieve a particular source widget provider in case the provider has more than one, it should be unique among all providers.

The default implementation returns the providerKey()

Return type:

str

abstract providerKey(self) str[source]

Provider key

Return type:

str