Class: QgsOwsConnection

class qgis.core.QgsOwsConnection

Bases: PyQt5.QtCore.QObject

Connections management

QgsOwsConnection(service: str, connName: str) Constructor

Parameters:
addWfsConnectionSettings(uri: QgsDataSourceUri, settingsKey: str) 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 QGIS: 3.26 use addWfsConnectionSettings with service and connection name parameters

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

New in version 3.26.

Parameters:
Return type:

QgsDataSourceUri

addWmsWcsConnectionSettings(uri: QgsDataSourceUri, settingsKey: 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 QSettings settingsKey.

Deprecated since version QGIS: 3.26 use addWmsWcsConnectionSettings with service and connection name parameters

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

New in version 3.26.

Parameters:
Return type:

QgsDataSourceUri

childEvent(self, QChildEvent)
connectNotify(self, QMetaMethod)
connectionInfo(self) str

Returns connection info string.

Return type:

str

connectionList(service: str) List[str]

Returns the list of connections for the specified service

Parameters:

service (str) –

Return type:

List[str]

connectionName(self) str

Returns the connection name.

Return type:

str

customEvent(self, QEvent)
deleteConnection(service: str, name: str)

Deletes the connection for the specified service with the specified name

Parameters:
  • service (str) –

  • name (str) –

disconnectNotify(self, QMetaMethod)
isSignalConnected(self, QMetaMethod) bool
receivers(self, PYQT_SIGNAL) int
selectedConnection(service: str) str

Retrieves the selected connection for the specified service

Parameters:

service (str) –

Return type:

str

sender(self) QObject
senderSignalIndex(self) int
service(self) str

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

Return type:

str

setSelectedConnection(service: str, name: str)

Marks the specified connection for the specified service as selected

Parameters:
  • service (str) –

  • name (str) –

timerEvent(self, QTimerEvent)
uri(self) QgsDataSourceUri

Returns the connection uri.

Return type:

QgsDataSourceUri