Skip to content

Commit ef21636

Browse files
committed
Followup e90ac56
Fix warnings, missing Q_OBJECT macro (cherry-picked from 2be125)
1 parent 4a5801b commit ef21636

File tree

3 files changed

+61
-21
lines changed

3 files changed

+61
-21
lines changed

python/core/qgspluginlayer.sip.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ Set source string. This is used for example in layer tree to show tooltip.
5959
protected:
6060
};
6161

62+
6263
/************************************************************************
6364
* This file has been generated automatically from *
6465
* *

src/core/qgspluginlayer.cpp

Lines changed: 34 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,6 @@
1818
#include "qgsmaplayerrenderer.h"
1919

2020

21-
/**
22-
A minimal data provider for plugin layers
23-
*/
24-
///@cond PRIVATE
25-
class QgsPluginLayerDataProvider : public QgsDataProvider
26-
{
27-
public:
28-
QgsPluginLayerDataProvider( const QString &layerType ) : mName( layerType ) {}
29-
void setExtent( const QgsRectangle &extent ) { mExtent = extent; }
30-
virtual QgsCoordinateReferenceSystem crs() const { return QgsCoordinateReferenceSystem(); }
31-
virtual QString name() const override { return mName; }
32-
QString description() const override { return ""; }
33-
virtual QgsRectangle extent() const { return mExtent; }
34-
virtual bool isValid() const { return true; }
35-
36-
private:
37-
QString mName;
38-
QgsRectangle mExtent;
39-
};
40-
///@endcond
41-
4221
QgsPluginLayer::QgsPluginLayer( const QString &layerType, const QString &layerName )
4322
: QgsMapLayer( PluginLayer, layerName )
4423
, mPluginLayerType( layerType )
@@ -79,3 +58,37 @@ const QgsDataProvider *QgsPluginLayer::dataProvider() const
7958
{
8059
return mDataProvider;
8160
}
61+
62+
//
63+
// QgsPluginLayerDataProvider
64+
//
65+
///@cond PRIVATE
66+
QgsPluginLayerDataProvider::QgsPluginLayerDataProvider( const QString &layerType )
67+
: mName( layerType )
68+
{}
69+
70+
QgsCoordinateReferenceSystem QgsPluginLayerDataProvider::crs() const
71+
{
72+
return QgsCoordinateReferenceSystem();
73+
}
74+
75+
QString QgsPluginLayerDataProvider::name() const
76+
{
77+
return mName;
78+
}
79+
80+
QString QgsPluginLayerDataProvider::description() const
81+
{
82+
return QString();
83+
}
84+
85+
QgsRectangle QgsPluginLayerDataProvider::extent() const
86+
{
87+
return mExtent;
88+
}
89+
90+
bool QgsPluginLayerDataProvider::isValid() const
91+
{
92+
return true;
93+
}
94+
///@endcond

src/core/qgspluginlayer.h

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,30 @@ class CORE_EXPORT QgsPluginLayer : public QgsMapLayer
6363
QgsDataProvider *mDataProvider;
6464
};
6565

66+
#ifndef SIP_RUN
67+
///@cond PRIVATE
68+
69+
/**
70+
* A minimal data provider for plugin layers
71+
*/
72+
class QgsPluginLayerDataProvider : public QgsDataProvider
73+
{
74+
Q_OBJECT
75+
76+
public:
77+
QgsPluginLayerDataProvider( const QString &layerType );
78+
void setExtent( const QgsRectangle &extent ) { mExtent = extent; }
79+
virtual QgsCoordinateReferenceSystem crs() const override;
80+
virtual QString name() const override;
81+
QString description() const override;
82+
virtual QgsRectangle extent() const override;
83+
virtual bool isValid() const override;
84+
85+
private:
86+
QString mName;
87+
QgsRectangle mExtent;
88+
};
89+
///@endcond
90+
#endif
91+
6692
#endif // QGSPLUGINLAYER_H

0 commit comments

Comments
 (0)