QGIS API Documentation 3.39.0-Master (699c004a5df)
Loading...
Searching...
No Matches
Classes | Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | List of all members
QgsOWSSourceSelect Class Reference

Dialog to create connections and add layers WCS etc. More...

#include <qgsowssourceselect.h>

Inheritance diagram for QgsOWSSourceSelect:
Inheritance graph
[legend]

Classes

struct  SupportedFormat
 Formats supported by provider. More...
 

Public Member Functions

 QgsOWSSourceSelect (const QString &service, QWidget *parent=nullptr, Qt::WindowFlags fl=QgsGuiUtils::ModalDialogFlags, QgsProviderRegistry::WidgetMode widgetMode=QgsProviderRegistry::WidgetMode::Standalone)
 Constructor.
 
void refresh () override
 Triggered when the provider's connections need to be refreshed.
 
void reset () override
 Called when this source select widget is being shown in a "new and clean" dialog.
 
void setMapCanvas (QgsMapCanvas *mapCanvas) override
 Sets the dialog map canvas.
 
- Public Member Functions inherited from QgsAbstractDataSourceWidget
virtual QgsMapCanvasmapCanvas ()
 Returns the dialog map canvas.
 
virtual void setBrowserModel (QgsBrowserModel *model)
 Sets a browser model to use with the widget.
 

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 Member 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.
 
QString connectionInfo ()
 Connection info (uri)
 
QString connName ()
 Connection name.
 
QgsTreeWidgetItemcreateItem (int id, const QStringList &names, QMap< int, QgsTreeWidgetItem * > &items, int &layerAndStyleCount, const QMap< int, int > &layerParents, const QMap< int, QStringList > &layerParentNames)
 create an item including possible parents
 
QString descriptionForAuthId (const QString &authId)
 Returns a textual description for the authority id.
 
virtual void enableLayersForCrs (QTreeWidgetItem *item)
 
void populateConnectionList ()
 Populate the connection list combo box.
 
void populateCrs ()
 Sets supported CRSs.
 
void populateFormats ()
 Populate supported formats.
 
virtual void populateLayerList ()
 Populate the layer list.
 
void populateTimes ()
 Populate times.
 
void prepareExtent ()
 Prepares the spatial extent box with the general settings including original crs, destination crs and the map canvas if it is available.
 
virtual QList< QgsOWSSourceSelect::SupportedFormatproviderFormats ()
 List of image formats (encodings) supported by provider.
 
QNetworkRequest::CacheLoadControl selectedCacheLoadControl ()
 Returns currently selected cache load control.
 
QString selectedCrs ()
 Returns currently selected Crs.
 
QString selectedFormat ()
 Returns currently selected format.
 
virtual QStringList selectedLayersCrses ()
 Server CRS supported for currently selected layer item(s)
 
virtual QStringList selectedLayersFormats ()
 List of formats supported for currently selected layer item(s)
 
virtual QStringList selectedLayersTimes ()
 List of times (temporalDomain timePosition/timePeriod for currently selected layer item(s)
 
QString selectedTime ()
 Returns currently selected time.
 
void setConnectionListPosition ()
 Sets the server connection combo box to that stored in the config file.
 
- Protected Member Functions inherited from QgsAbstractDataSourceWidget
 QgsAbstractDataSourceWidget (QWidget *parent=nullptr, Qt::WindowFlags fl=QgsGuiUtils::ModalDialogFlags, QgsProviderRegistry::WidgetMode widgetMode=QgsProviderRegistry::WidgetMode::Standalone)
 Constructor.
 
QPushButton * addButton () const
 Returns the add Button.
 
QgsBrowserModelbrowserModel ()
 Returns the associated browser model (may be nullptr).
 
void setupButtons (QDialogButtonBox *buttonBox)
 Connect the ok and apply/add buttons to the slots.
 
QgsProviderRegistry::WidgetMode widgetMode () const
 Returns the widget mode.
 

Protected Attributes

QString mConnectionInfo
 Connection info for selected connection.
 
QString mConnName
 Name for selected connection.
 
QMap< QString, QString > mCrsNames
 
QList< QTreeWidgetItem * > mCurrentSelection
 
QTableWidgetItem * mCurrentTileset = nullptr
 
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.
 

Additional Inherited Members

- Public Slots inherited from QgsAbstractDataSourceWidget
virtual void addButtonClicked ()
 Triggered when the add button is clicked, the add layer signal is emitted Concrete classes should implement the right behavior depending on the layer being added.
 
virtual bool configureFromUri (const QString &uri)
 Configure the widget from a layer uri by selecting the layer path or connection options.
 
- Signals inherited from QgsAbstractDataSourceWidget
void addDatabaseLayers (const QStringList &paths, const QString &providerKey)
 Emitted when a DB layer has been selected for addition.
 
void addLayer (Qgis::LayerType type, const QString &url, const QString &baseName, const QString &providerKey)
 Emitted when a layer has been selected for addition.
 
Q_DECL_DEPRECATED void addMeshLayer (const QString &url, const QString &baseName, const QString &providerKey)
 Emitted when a mesh layer has been selected for addition.
 
Q_DECL_DEPRECATED void addPointCloudLayer (const QString &url, const QString &baseName, const QString &providerKey)
 Emitted when a point cloud layer has been selected for addition.
 
Q_DECL_DEPRECATED void addRasterLayer (const QString &rasterLayerPath, const QString &baseName, const QString &providerKey)
 Emitted when a raster layer has been selected for addition.
 
void addRasterLayers (const QStringList &layersList)
 Emitted when one or more GDAL supported layers are selected for addition.
 
Q_DECL_DEPRECATED void addVectorLayer (const QString &uri, const QString &layerName, const QString &providerKey=QString())
 Emitted when a vector layer has been selected for addition.
 
void addVectorLayers (const QStringList &layerList, const QString &encoding, const QString &dataSourceType)
 Emitted when one or more OGR supported layers are selected for addition.
 
Q_DECL_DEPRECATED void addVectorTileLayer (const QString &url, const QString &baseName)
 Emitted when a vector tile layer has been selected for addition.
 
void connectionsChanged ()
 Emitted when the provider's connections have changed This signal is normally forwarded the app and used to refresh browser items.
 
void enableButtons (bool enable)
 Emitted when the ok/add buttons should be enabled/disabled.
 
Q_DECL_DEPRECATED void progress (int, int)
 Emitted when a progress dialog is shown by the provider dialog.
 
void progressMessage (QString message)
 Emitted when a progress dialog is shown by the provider dialog.
 
void pushMessage (const QString &title, const QString &message, const Qgis::MessageLevel level=Qgis::MessageLevel::Info)
 Emitted when a message with title and level must be shown to the user using the parent visible message bar.
 
void replaceVectorLayer (const QString &oldId, const QString &source, const QString &name, const QString &provider)
 Emitted when a layer needs to be replaced.
 

Detailed Description

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.

Definition at line 52 of file qgsowssourceselect.h.

Constructor & Destructor Documentation

◆ QgsOWSSourceSelect()

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

Constructor.

Definition at line 54 of file qgsowssourceselect.cpp.

Member Function Documentation

◆ addDefaultServers()

void QgsOWSSourceSelect::addDefaultServers ( )
protected

Add a few example servers to the list.

Definition at line 630 of file qgsowssourceselect.cpp.

◆ clearCrs()

void QgsOWSSourceSelect::clearCrs ( )
protected

Clear CRSs.

Definition at line 485 of file qgsowssourceselect.cpp.

◆ clearFormats()

void QgsOWSSourceSelect::clearFormats ( )
protected

Clear previously set formats.

Definition at line 143 of file qgsowssourceselect.cpp.

◆ clearTimes()

void QgsOWSSourceSelect::clearTimes ( )
protected

Clear times.

Definition at line 241 of file qgsowssourceselect.cpp.

◆ connectionInfo()

QString QgsOWSSourceSelect::connectionInfo ( )
protected

Connection info (uri)

Definition at line 524 of file qgsowssourceselect.cpp.

◆ connName()

QString QgsOWSSourceSelect::connName ( )
protected

Connection name.

Definition at line 519 of file qgsowssourceselect.cpp.

◆ createItem()

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

Note
not available in Python bindings

Definition at line 330 of file qgsowssourceselect.cpp.

◆ descriptionForAuthId()

QString QgsOWSSourceSelect::descriptionForAuthId ( const QString &  authId)
protected

Returns a textual description for the authority id.

Definition at line 620 of file qgsowssourceselect.cpp.

◆ enableLayersForCrs()

void QgsOWSSourceSelect::enableLayersForCrs ( QTreeWidgetItem *  item)
protectedvirtual

Definition at line 389 of file qgsowssourceselect.cpp.

◆ populateConnectionList()

void QgsOWSSourceSelect::populateConnectionList ( )
protected

Populate the connection list combo box.

Definition at line 247 of file qgsowssourceselect.cpp.

◆ populateCrs()

void QgsOWSSourceSelect::populateCrs ( )
protected

Sets supported CRSs.

Definition at line 438 of file qgsowssourceselect.cpp.

◆ populateFormats()

void QgsOWSSourceSelect::populateFormats ( )
protected

Populate supported formats.

Definition at line 149 of file qgsowssourceselect.cpp.

◆ populateLayerList()

void QgsOWSSourceSelect::populateLayerList ( )
protectedvirtual

Populate the layer list.

Definition at line 364 of file qgsowssourceselect.cpp.

◆ populateTimes()

void QgsOWSSourceSelect::populateTimes ( )
protected

Populate times.

Definition at line 234 of file qgsowssourceselect.cpp.

◆ prepareExtent()

void QgsOWSSourceSelect::prepareExtent ( )
protected

Prepares the spatial extent box with the general settings including original crs, destination crs and the map canvas if it is available.

Since
QGIS 3.26

Definition at line 120 of file qgsowssourceselect.cpp.

◆ providerFormats()

QList< QgsOWSSourceSelect::SupportedFormat > QgsOWSSourceSelect::providerFormats ( )
protectedvirtual

List of image formats (encodings) supported by provider.

Returns
list of format/label pairs

Definition at line 698 of file qgsowssourceselect.cpp.

◆ refresh()

void QgsOWSSourceSelect::refresh ( )
overridevirtual

Triggered when the provider's connections need to be refreshed.

Reimplemented from QgsAbstractDataSourceWidget.

Definition at line 133 of file qgsowssourceselect.cpp.

◆ reset()

void QgsOWSSourceSelect::reset ( )
overridevirtual

Called when this source select widget is being shown in a "new and clean" dialog.

The data source manager recycles existing source select widgets but will call this method on every reopening. This should clear any selection that has previously been done.

Since
QGIS 3.10

Reimplemented from QgsAbstractDataSourceWidget.

Definition at line 138 of file qgsowssourceselect.cpp.

◆ selectedCacheLoadControl()

QNetworkRequest::CacheLoadControl QgsOWSSourceSelect::selectedCacheLoadControl ( )
protected

Returns currently selected cache load control.

Definition at line 534 of file qgsowssourceselect.cpp.

◆ selectedCrs()

QString QgsOWSSourceSelect::selectedCrs ( )
protected

Returns currently selected Crs.

Definition at line 540 of file qgsowssourceselect.cpp.

◆ selectedFormat()

QString QgsOWSSourceSelect::selectedFormat ( )
protected

Returns currently selected format.

Definition at line 529 of file qgsowssourceselect.cpp.

◆ selectedLayersCrses()

QStringList QgsOWSSourceSelect::selectedLayersCrses ( )
protectedvirtual

Server CRS supported for currently selected layer item(s)

Definition at line 708 of file qgsowssourceselect.cpp.

◆ selectedLayersFormats()

QStringList QgsOWSSourceSelect::selectedLayersFormats ( )
protectedvirtual

List of formats supported for currently selected layer item(s)

Definition at line 703 of file qgsowssourceselect.cpp.

◆ selectedLayersTimes()

QStringList QgsOWSSourceSelect::selectedLayersTimes ( )
protectedvirtual

List of times (temporalDomain timePosition/timePeriod for currently selected layer item(s)

Definition at line 713 of file qgsowssourceselect.cpp.

◆ selectedTime()

QString QgsOWSSourceSelect::selectedTime ( )
protected

Returns currently selected time.

Definition at line 545 of file qgsowssourceselect.cpp.

◆ setConnectionListPosition()

void QgsOWSSourceSelect::setConnectionListPosition ( )
protected

Sets the server connection combo box to that stored in the config file.

Definition at line 550 of file qgsowssourceselect.cpp.

◆ setMapCanvas()

void QgsOWSSourceSelect::setMapCanvas ( QgsMapCanvas mapCanvas)
overridevirtual

Sets the dialog map canvas.

See also
mapCanvas()

Reimplemented from QgsAbstractDataSourceWidget.

Definition at line 114 of file qgsowssourceselect.cpp.

◆ showError

void QgsOWSSourceSelect::showError ( const QString &  title,
const QString &  format,
const QString &  error 
)
protectedslot

show whatever error is exposed.

Definition at line 593 of file qgsowssourceselect.cpp.

◆ showStatusMessage

void QgsOWSSourceSelect::showStatusMessage ( const QString &  message)
protectedslot

Sets status message to theMessage.

Definition at line 584 of file qgsowssourceselect.cpp.

Member Data Documentation

◆ mConnectionInfo

QString QgsOWSSourceSelect::mConnectionInfo
protected

Connection info for selected connection.

Definition at line 191 of file qgsowssourceselect.h.

◆ mConnName

QString QgsOWSSourceSelect::mConnName
protected

Name for selected connection.

Definition at line 188 of file qgsowssourceselect.h.

◆ mCrsNames

QMap<QString, QString> QgsOWSSourceSelect::mCrsNames
protected

Definition at line 159 of file qgsowssourceselect.h.

◆ mCurrentSelection

QList<QTreeWidgetItem *> QgsOWSSourceSelect::mCurrentSelection
protected

Definition at line 184 of file qgsowssourceselect.h.

◆ mCurrentTileset

QTableWidgetItem* QgsOWSSourceSelect::mCurrentTileset = nullptr
protected

Definition at line 185 of file qgsowssourceselect.h.

◆ mLastLayerName

QString QgsOWSSourceSelect::mLastLayerName
protected

layer name derived from latest layer selection (updated as long it's not edited manually)

Definition at line 157 of file qgsowssourceselect.h.

◆ mService

QString QgsOWSSourceSelect::mService
protected

Service name.

Definition at line 135 of file qgsowssourceselect.h.

◆ mUri

QgsDataSourceUri QgsOWSSourceSelect::mUri
protected

URI for selected connection.

Definition at line 194 of file qgsowssourceselect.h.


The documentation for this class was generated from the following files: