Class: QgsSubsetStringEditorProvider

class qgis.gui.QgsSubsetStringEditorProvider

Bases: sip.wrapper

This is the interface for those who want to provide a dialog to edit a subset string.

New in version 3.18:

Methods

canHandleLayer

Returns true if the provider can handle the layer

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.

createDialog

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

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.

providerKey

Provider key

canHandleLayer(self, layer: QgsVectorLayer) bool

Returns true if the provider can handle the layer

Parameters:

layer (QgsVectorLayer) –

Return type:

bool

canHandleLayerStorageType(self, layer: QgsVectorLayer) bool

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

Return type:

bool

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

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

  • parent (QWidget = None) –

  • fl (Union[Qt.WindowFlags) –

Return type:

QgsSubsetStringEditorInterface

name(self) str

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

providerKey(self) str

Provider key

Return type:

str