Class: QgsOwsConnection

Connections management for OWS connections.

Class Hierarchy

Inheritance diagram of qgis.core.QgsOwsConnection

Base classes

QObject

class qgis.core.QgsOwsConnection[source]

Bases: QObject

__init__(service: str | None, connName: str | None)

Constructor

Parameters:
  • service (Optional[str]) – service name: WMS,WFS,WCS

  • connName (Optional[str]) – connection name

static addWfsConnectionSettings(uri: QgsDataSourceUri, settingsKey: str | None) QgsDataSourceUri

Adds uri parameters relating to the settings for a WFS connection to a QgsDataSourceUri uri. Connection settings are taken from the specified QSettings settingsKey.

Deprecated since version 3.26: Use addWfsConnectionSettings with service and connection name parameters.

addWfsConnectionSettings(uri: QgsDataSourceUri, service: Optional[str], connName: Optional[str]) -> QgsDataSourceUri Adds uri parameters relating to the settings for a WFS connection to a QgsDataSourceUri uri. Connection settings are taken from the specified servcie and connName

Added in version 3.26.

Parameters:
Return type:

QgsDataSourceUri

static addWmsWcsConnectionSettings(uri: QgsDataSourceUri, settingsKey: str | None) QgsDataSourceUri

Adds uri parameters relating to the settings for a WMS or WCS connection to a QgsDataSourceUri uri. Connection settings are taken from the specified QSettings settingsKey.

Deprecated since version 3.26: Use addWmsWcsConnectionSettings with service and connection name parameters.

addWmsWcsConnectionSettings(uri: QgsDataSourceUri, service: Optional[str], connName: Optional[str]) -> QgsDataSourceUri Adds uri parameters relating to the settings for a WMS or WCS connection to a QgsDataSourceUri uri. Connection settings are taken from the specified servcie and connName

Added in version 3.26.

Parameters:
Return type:

QgsDataSourceUri

connectionInfo(self) str[source]

Returns connection info string.

Return type:

str

static connectionList(service: str | None) List[str][source]

Returns the list of connections for the specified service

Parameters:

service (Optional[str])

Return type:

List[str]

connectionName(self) str[source]

Returns the connection name.

Return type:

str

static deleteConnection(service: str | None, name: str | None)[source]

Deletes the connection for the specified service with the specified name

Parameters:
  • service (Optional[str])

  • name (Optional[str])

static selectedConnection(service: str | None) str[source]

Retrieves the selected connection for the specified service

Parameters:

service (Optional[str])

Return type:

str

service(self) str[source]

Returns a string representing the service type, e.g. “WMS”.

Return type:

str

static setSelectedConnection(service: str | None, name: str | None)[source]

Marks the specified connection for the specified service as selected

Parameters:
  • service (Optional[str])

  • name (Optional[str])

uri(self) QgsDataSourceUri[source]

Returns the connection uri.

Return type:

QgsDataSourceUri