QgsOWSSourceSelect class

Dialog to create connections and add layers WCS etc.

This dialog allows the user to define and save connection information for WMS servers, etc.

The user can then connect and add layers from the WCS server to the map canvas.

Base classes

class QgsAbstractDataSourceWidget
Abstract base Data Source Widget to create connections and add layers This class provides common functionality and the interface for all source select dialogs used by data providers to configure data sources and add layers.

Public types

struct SupportedFormat
Formats supported by provider.

Constructors, destructors, conversion operators

QgsOWSSourceSelect(const QString& service, QWidget* parent = nullptr, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags, QgsProviderRegistry::WidgetMode widgetMode = QgsProviderRegistry::WidgetMode::None)
Constructor.

Public slots

void refresh() override
Triggered when the provider's connections need to be refreshed.

Protected functions

void addDefaultServers()
Add a few example servers to the list.
void clearCrs()
Clear CRSs.
void clearFormats()
Clear previously set formats.
void clearTimes()
Clear times.
auto connectionInfo() -> QString
Connection info (uri)
auto connName() -> QString
Connection name.
auto createItem(int id, const QStringList& names, QMap<int, QgsTreeWidgetItem*>& items, int& layerAndStyleCount, const QMap<int, int>& layerParents, const QMap<int, QStringList>& layerParentNames) -> QgsTreeWidgetItem*
create an item including possible parents
auto descriptionForAuthId(const QString& authId) -> QString
Returns a textual description for the authority id.
void populateConnectionList()
Populate the connection list combo box.
void populateCrs()
Sets supported CRSs.
void populateFormats()
Populate supported formats.
void populateLayerList() virtual
Populate the layer list.
void populateTimes()
Populate times.
auto providerFormats() -> QList<QgsOWSSourceSelect::SupportedFormat> virtual
List of image formats (encodings) supported by provider.
auto selectedCacheLoadControl() -> QNetworkRequest::CacheLoadControl
Returns currently selected cache load control.
auto selectedCrs() -> QString
Returns currently selected Crs.
auto selectedFormat() -> QString
Returns currently selected format.
auto selectedLayersCrses() -> QStringList virtual
Server CRS supported for currently selected layer item(s)
auto selectedLayersFormats() -> QStringList virtual
List of formats supported for currently selected layer item(s)
auto selectedLayersTimes() -> QStringList virtual
List of times (temporalDomain timePosition/timePeriod for currently selected layer item(s)
auto selectedTime() -> QString
Returns currently selected time.
void setConnectionListPosition()
Sets the server connection combo box to that stored in the config file.

Protected slots

void showError(const QString& title, const QString& format, const QString& error)
show whatever error is exposed.
void showStatusMessage(const QString& message)
Sets status message to theMessage.

Protected variables

QString mConnectionInfo
Connection info for selected connection.
QString mConnName
Name for selected connection.
QString mLastLayerName
layer name derived from latest layer selection (updated as long it's not edited manually)
QString mService
Service name.
QgsDataSourceUri mUri
URI for selected connection.

Private slots

void mLayersTreeWidget_itemSelectionChanged() virtual
Signaled when a layer selection is changed.

Function documentation

QgsTreeWidgetItem* QgsOWSSourceSelect::createItem(int id, const QStringList& names, QMap<int, QgsTreeWidgetItem*>& items, int& layerAndStyleCount, const QMap<int, int>& layerParents, const QMap<int, QStringList>& layerParentNames) protected

create an item including possible parents

void QgsOWSSourceSelect::populateLayerList() virtual protected

Populate the layer list.

Returns
false if the layers could not be retrieved or parsed

QList<QgsOWSSourceSelect::SupportedFormat> QgsOWSSourceSelect::providerFormats() virtual protected

List of image formats (encodings) supported by provider.

Returns list of format/label pairs