Allow plugin layers to set their source

This commit is contained in:
Martin Dobias 2016-02-29 17:17:14 +08:00
parent 317639f1e0
commit 5090491998
3 changed files with 17 additions and 0 deletions

View File

@ -11,8 +11,14 @@ class QgsPluginLayer : QgsMapLayer
/** Return plugin layer type (the same as used in QgsPluginLayerRegistry) */
QString pluginLayerType();
/** Set extent of the layer */
void setExtent( const QgsRectangle &extent );
/** Set source string. This is used for example in layer tree to show tooltip.
* @note added in 2.16
*/
void setSource( const QString& source );
//! return a list of symbology items for the legend
//! (defult implementation returns nothing)
//! @note Added in v2.1

View File

@ -33,6 +33,11 @@ void QgsPluginLayer::setExtent( const QgsRectangle &extent )
mExtent = extent;
}
void QgsPluginLayer::setSource( const QString& source )
{
mDataSource = source;
}
QgsLegendSymbologyList QgsPluginLayer::legendSymbologyItems( QSize iconSize )
{
Q_UNUSED( iconSize );

View File

@ -37,8 +37,14 @@ class CORE_EXPORT QgsPluginLayer : public QgsMapLayer
/** Return plugin layer type (the same as used in QgsPluginLayerRegistry) */
QString pluginLayerType();
/** Set extent of the layer */
void setExtent( const QgsRectangle &extent ) override;
/** Set source string. This is used for example in layer tree to show tooltip.
* @note added in 2.16
*/
void setSource( const QString& source );
//! return a list of symbology items for the legend
//! (defult implementation returns nothing)
//! @note Added in v2.1