SWMMVis  6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
WMSConnectionDialog Class Reference

Dialog for connecting to an OGC WMS service and selecting a layer to add. More...

#include <wmsconnectiondialog.h>

Inheritance diagram for WMSConnectionDialog:
Collaboration diagram for WMSConnectionDialog:

Public Member Functions

 WMSConnectionDialog (QWidget *parent=nullptr)
 
 ~WMSConnectionDialog () override
 
WMSLayercreateLayer (QObject *project=nullptr) const
 Returns a configured WMSLayer instance for the user's selection.
 

Detailed Description

Dialog for connecting to an OGC WMS service and selecting a layer to add.

Own implementation — no QGIS dependency. The dialog allows the user to:

  1. Enter a WMS base URL.
  2. Click "Connect" to asynchronously fetch GetCapabilities.
  3. Browse the returned layer tree.
  4. Pick a layer, style, image format, and CRS.
  5. Accept to receive a configured WMSLayer ready to be added to the canvas.

The dialog also persists a list of recently used WMS URLs in QSettings.

Usage:

if (dlg.exec() == QDialog::Accepted)
{
WMSLayer *layer = dlg.createLayer(project);
canvas->addLayer(layer);
}
Dialog for connecting to an OGC WMS service and selecting a layer to add.
Definition wmsconnectiondialog.h:54
A map layer that fetches and displays images from an OGC WMS service.
Definition wmslayer.h:70

Constructor & Destructor Documentation

◆ WMSConnectionDialog()

WMSConnectionDialog::WMSConnectionDialog ( QWidget *  parent = nullptr)
explicit

◆ ~WMSConnectionDialog()

WMSConnectionDialog::~WMSConnectionDialog ( )
override

Member Function Documentation

◆ createLayer()

WMSLayer * WMSConnectionDialog::createLayer ( QObject *  project = nullptr) const

Returns a configured WMSLayer instance for the user's selection.

Caller takes ownership. Returns nullptr if rejected or no layer selected.

Parameters
projectOptional Qt parent for the new layer object.

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