Class: QgsOwsConnection

class qgis.core.QgsOwsConnection

Bases: PyQt5.QtCore.QObject

Connections management

QgsOwsConnection(service: Optional[str], connName: Optional[str]) Constructor

Parameters:
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 QGIS: 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

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 QGIS: 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

childEvent(self, a0: QChildEvent | None)
connectNotify(self, signal: QMetaMethod)
connectionInfo(self) str

Returns connection info string.

Return type:

str

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

Returns the list of connections for the specified service

Parameters:

service (Optional[str])

Return type:

List[str]

connectionName(self) str

Returns the connection name.

Return type:

str

customEvent(self, a0: QEvent | None)
deleteConnection(service: str | None, name: str | None)

Deletes the connection for the specified service with the specified name

Parameters:
  • service (Optional[str])

  • name (Optional[str])

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

Retrieves the selected connection for the specified service

Parameters:

service (Optional[str])

Return type:

str

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

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

Return type:

str

setSelectedConnection(service: str | None, name: str | None)

Marks the specified connection for the specified service as selected

Parameters:
  • service (Optional[str])

  • name (Optional[str])

timerEvent(self, a0: QTimerEvent | None)
uri(self) QgsDataSourceUri

Returns the connection uri.

Return type:

QgsDataSourceUri