added documentation on new wms layer class

This commit is contained in:
Samweli 2020-01-07 20:33:20 +03:00 committed by Nyall Dawson
parent 91604f1896
commit bc0b427005
2 changed files with 16 additions and 2 deletions

View File

@ -251,8 +251,12 @@ QgsWMSLayerCollectionItem::QgsWMSLayerCollectionItem( QgsDataItem *parent, QStri
// Attention, the name may be empty
QgsDebugMsgLevel( QString::number( layerProperty.orderId ) + ' ' + layerProperty.name + ' ' + layerProperty.title, 2 );
QString pathName = layerProperty.name.isEmpty() ? QString::number( layerProperty.orderId ) : layerProperty.name;
QgsWMSLayerItem *layer = new QgsWMSLayerItem( this, layerProperty.title, mPath + '/' + pathName, mCapabilitiesProperty, dataSourceUri, layerProperty );
//mChildren.append( layer );
if ( layerProperty.name.isEmpty() )
layer = new QgsWMSLayerCollectionItem( this, layerProperty.title, mPath + '/' + pathName, capabilitiesProperty, dataSourceUri, layerProperty );
else
layer = new QgsWMSLayerItem( this, layerProperty.title, mPath + '/' + pathName, mCapabilitiesProperty, dataSourceUri, layerProperty );
addChildItem( layer );
}

View File

@ -41,6 +41,11 @@ class QgsWMSConnectionItem : public QgsDataCollectionItem
QgsWmsCapabilitiesDownload *mCapabilitiesDownload = nullptr;
};
/**
* \brief WMS Layer Collection.
*
* This collection contains a WMS Layer element that can enclose other layers
*/
class QgsWMSLayerCollectionItem : public QgsDataCollectionItem
{
Q_OBJECT
@ -52,8 +57,13 @@ class QgsWMSLayerCollectionItem : public QgsDataCollectionItem
bool equal( const QgsDataItem *other ) override;
//! Stores GetCapabilities response
QgsWmsCapabilitiesProperty mCapabilitiesProperty;
//! Stores WMS connection information
QgsDataSourceUri mDataSourceUri;
//! WMS Layer properties, can be inherited by subsidiary layers
QgsWmsLayerProperty mLayerProperty;
};