Skip to content

Commit 5090491

Browse files
committed
Allow plugin layers to set their source
1 parent 317639f commit 5090491

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

python/core/qgspluginlayer.sip

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,14 @@ class QgsPluginLayer : QgsMapLayer
1111
/** Return plugin layer type (the same as used in QgsPluginLayerRegistry) */
1212
QString pluginLayerType();
1313

14+
/** Set extent of the layer */
1415
void setExtent( const QgsRectangle &extent );
1516

17+
/** Set source string. This is used for example in layer tree to show tooltip.
18+
* @note added in 2.16
19+
*/
20+
void setSource( const QString& source );
21+
1622
//! return a list of symbology items for the legend
1723
//! (defult implementation returns nothing)
1824
//! @note Added in v2.1

src/core/qgspluginlayer.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ void QgsPluginLayer::setExtent( const QgsRectangle &extent )
3333
mExtent = extent;
3434
}
3535

36+
void QgsPluginLayer::setSource( const QString& source )
37+
{
38+
mDataSource = source;
39+
}
40+
3641
QgsLegendSymbologyList QgsPluginLayer::legendSymbologyItems( QSize iconSize )
3742
{
3843
Q_UNUSED( iconSize );

src/core/qgspluginlayer.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,14 @@ class CORE_EXPORT QgsPluginLayer : public QgsMapLayer
3737
/** Return plugin layer type (the same as used in QgsPluginLayerRegistry) */
3838
QString pluginLayerType();
3939

40+
/** Set extent of the layer */
4041
void setExtent( const QgsRectangle &extent ) override;
4142

43+
/** Set source string. This is used for example in layer tree to show tooltip.
44+
* @note added in 2.16
45+
*/
46+
void setSource( const QString& source );
47+
4248
//! return a list of symbology items for the legend
4349
//! (defult implementation returns nothing)
4450
//! @note Added in v2.1

0 commit comments

Comments
 (0)