Skip to content
Permalink
Browse files

Followup e90ac56

Fix warnings, missing Q_OBJECT macro

(cherry-picked from 2be125)
  • Loading branch information
nyalldawson committed Mar 22, 2018
1 parent 4a5801b commit ef21636eff37f5e57289e1f9358cbec65ac7c148
Showing with 61 additions and 21 deletions.
  1. +1 −0 python/core/qgspluginlayer.sip.in
  2. +34 −21 src/core/qgspluginlayer.cpp
  3. +26 −0 src/core/qgspluginlayer.h
@@ -59,6 +59,7 @@ Set source string. This is used for example in layer tree to show tooltip.
protected:
};


/************************************************************************
* This file has been generated automatically from *
* *
@@ -18,27 +18,6 @@
#include "qgsmaplayerrenderer.h"


/**
A minimal data provider for plugin layers
*/
///@cond PRIVATE
class QgsPluginLayerDataProvider : public QgsDataProvider
{
public:
QgsPluginLayerDataProvider( const QString &layerType ) : mName( layerType ) {}
void setExtent( const QgsRectangle &extent ) { mExtent = extent; }
virtual QgsCoordinateReferenceSystem crs() const { return QgsCoordinateReferenceSystem(); }
virtual QString name() const override { return mName; }
QString description() const override { return ""; }
virtual QgsRectangle extent() const { return mExtent; }
virtual bool isValid() const { return true; }

private:
QString mName;
QgsRectangle mExtent;
};
///@endcond

QgsPluginLayer::QgsPluginLayer( const QString &layerType, const QString &layerName )
: QgsMapLayer( PluginLayer, layerName )
, mPluginLayerType( layerType )
@@ -79,3 +58,37 @@ const QgsDataProvider *QgsPluginLayer::dataProvider() const
{
return mDataProvider;
}

//
// QgsPluginLayerDataProvider
//
///@cond PRIVATE
QgsPluginLayerDataProvider::QgsPluginLayerDataProvider( const QString &layerType )
: mName( layerType )
{}

QgsCoordinateReferenceSystem QgsPluginLayerDataProvider::crs() const
{
return QgsCoordinateReferenceSystem();
}

QString QgsPluginLayerDataProvider::name() const
{
return mName;
}

QString QgsPluginLayerDataProvider::description() const
{
return QString();
}

QgsRectangle QgsPluginLayerDataProvider::extent() const
{
return mExtent;
}

bool QgsPluginLayerDataProvider::isValid() const
{
return true;
}
///@endcond
@@ -63,4 +63,30 @@ class CORE_EXPORT QgsPluginLayer : public QgsMapLayer
QgsDataProvider *mDataProvider;
};

#ifndef SIP_RUN
///@cond PRIVATE

/**
* A minimal data provider for plugin layers
*/
class QgsPluginLayerDataProvider : public QgsDataProvider
{
Q_OBJECT

public:
QgsPluginLayerDataProvider( const QString &layerType );
void setExtent( const QgsRectangle &extent ) { mExtent = extent; }
virtual QgsCoordinateReferenceSystem crs() const override;
virtual QString name() const override;
QString description() const override;
virtual QgsRectangle extent() const override;
virtual bool isValid() const override;

private:
QString mName;
QgsRectangle mExtent;
};
///@endcond
#endif

#endif // QGSPLUGINLAYER_H

0 comments on commit ef21636

Please sign in to comment.
You can’t perform that action at this time.