Class: QgsSubsetStringEditorProvider

An interface for widgets which edit a subset string.

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(), createDialog(), providerKey()

Abstract Methods

canHandleLayer

Returns true if the provider can handle the layer

createDialog

Creates a new dialog to edit the subset string of the provided layer.

providerKey

Provider key

Virtual Methods

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

canHandleLayerStorageType

Returns true if the provider can handle specifically the layer->:py:func:~QgsSubsetStringEditorProvider.provider->:py:func:~QgsSubsetStringEditorProvider.storageType This method will only be called if canHandleLayer() returned true.

name

Subset string editor provider name, this is useful to retrieve a particular subset string editor in case the provider has more than one, it should be unique among all providers.

class qgis.gui.QgsSubsetStringEditorProvider[source]

Bases: object

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

Returns true if the provider can handle the layer

Parameters:

layer (Optional[QgsVectorLayer])

Return type:

bool

virtual canHandleLayerStorageType(self, layer: QgsVectorLayer | None) bool[source]

Returns true if the provider can handle specifically the layer->:py:func:~QgsSubsetStringEditorProvider.provider->:py:func:~QgsSubsetStringEditorProvider.storageType This method will only be called if canHandleLayer() returned true. Typically a generic SQL provider for the OGR provider will return false, whereas a dedicated plugin with a specific behavior for a OGR driver will return true.

Parameters:

layer (Optional[QgsVectorLayer])

Return type:

bool

abstract createDialog(self, layer: QgsVectorLayer | None, parent: QWidget | None = None, fl: Qt.WindowFlags | Qt.WindowType = QgsGuiUtils.ModalDialogFlags) QgsSubsetStringEditorInterface | None[source]

Creates a new dialog to edit the subset string of the provided layer. It may return None if it cannot handle the layer. The returned object must be destroyed by the caller. On successful accept(), the QgsSubsetStringEditorInterface implementation is responsible for setting the updated string on layer.

Parameters:
  • layer (Optional[QgsVectorLayer])

  • parent (Optional[QWidget] = None)

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

Return type:

Optional[QgsSubsetStringEditorInterface]

virtual name(self) str[source]

Subset string editor provider name, this is useful to retrieve a particular subset string editor 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