Class: QgsProviderSourceWidget

Base class for widgets which allow customization of a provider’s source URI.

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: setSourceUri(), sourceUri()

Class Hierarchy

Inheritance diagram of qgis.gui.QgsProviderSourceWidget

Base classes

QWidget

QObject

QPaintDevice

Abstract Methods

setSourceUri

Sets the source uri to show in the widget.

sourceUri

Returns the source URI as currently defined by the widget.

Virtual Methods

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

groupTitle

Returns an optional group title for the source settings, for use in layer properties dialogs.

mapCanvas

Returns the map canvas associated with the widget.

setMapCanvas

Sets a map canvas associated with the widget.

Signals

changed

Emitted whenever the configuration of the widget changes.

validChanged

Emitted whenever the validation status of the widget changes.

class qgis.gui.QgsProviderSourceWidget[source]

Bases: QWidget

__init__(parent: QWidget | None = None)

Constructor for QgsProviderSourceWidget with the specified parent widget.

Parameters:

parent (Optional[QWidget] = None)

signal changed[source]

Emitted whenever the configuration of the widget changes.

Added in version 3.30.

virtual groupTitle(self) str[source]

Returns an optional group title for the source settings, for use in layer properties dialogs.

If not specified, a default title will be used.

Added in version 3.36.

Return type:

str

virtual mapCanvas(self) QgsMapCanvas | None[source]

Returns the map canvas associated with the widget.

Added in version 3.26.

Return type:

Optional[QgsMapCanvas]

virtual setMapCanvas(self, mapCanvas: QgsMapCanvas | None)[source]

Sets a map canvas associated with the widget.

Added in version 3.26.

Parameters:

mapCanvas (Optional[QgsMapCanvas])

abstract setSourceUri(self, uri: str | None)[source]

Sets the source uri to show in the widget.

See also

sourceUri()

Parameters:

uri (Optional[str])

abstract sourceUri(self) str[source]

Returns the source URI as currently defined by the widget.

See also

setSourceUri()

Return type:

str

signal validChanged(isValid: bool)[source]

Emitted whenever the validation status of the widget changes.

If isValid is False then the widget is not valid, and any dialog using the widget should be prevented from being accepted.

Parameters:

isValid (bool)