Class: QgsOwsConnection

Connections management for OWS connections.

Class Hierarchy

Inheritance diagram of qgis.core.QgsOwsConnection

Base classes

QObject

Methods

connectionInfo

Returns connection info string.

connectionName

Returns the connection name.

service

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

uri

Returns the connection uri.

Static Methods

addWfsConnectionSettings

Adds uri parameters relating to the settings for a WFS connection to a QgsDataSourceUri uri.

addWmsWcsConnectionSettings

Adds uri parameters relating to the settings for a WMS or WCS connection to a QgsDataSourceUri uri.

connectionList

Returns the list of connections for the specified service

deleteConnection

Deletes the connection for the specified service with the specified name

selectedConnection

Retrieves the selected connection for the specified service

setSelectedConnection

Marks the specified connection for the specified service as selected

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.

Parameters:
Return type:

QgsDataSourceUri

static addWfsConnectionSettings(uri: QgsDataSourceUri, service: str | None, connName: 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 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.

Parameters:
Return type:

QgsDataSourceUri

static addWmsWcsConnectionSettings(uri: QgsDataSourceUri, service: str | None, connName: 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 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