Skip to content

Commit

Permalink
QgsVectorLayer, QgsVectorDataProvider are QgsFeatureSources
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed May 25, 2017
1 parent ce063b8 commit 8bfeb8f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion python/core/qgsvectordataprovider.sip
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ typedef QHash<int, QString> QgsAttrPalIndexNameHash;



class QgsVectorDataProvider : QgsDataProvider, QgsFeatureSink
class QgsVectorDataProvider : QgsDataProvider, QgsFeatureSink, QgsFeatureSource
{
%Docstring
This is the base class for vector data providers.
Expand Down
5 changes: 3 additions & 2 deletions python/core/qgsvectorlayer.sip
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ typedef QList<int> QgsAttributeList;
typedef QSet<int> QgsAttributeIds;


class QgsVectorLayer : QgsMapLayer, QgsExpressionContextGenerator, QgsFeatureSink
class QgsVectorLayer : QgsMapLayer, QgsExpressionContextGenerator, QgsFeatureSink, QgsFeatureSource
{
%Docstring
Represents a vector layer which manages a vector based data sets.
Expand Down Expand Up @@ -890,7 +890,8 @@ Return the provider type for this layer
:rtype: str
%End

QgsFeatureIterator getFeatures( const QgsFeatureRequest &request = QgsFeatureRequest() ) const;
virtual QgsFeatureIterator getFeatures( const QgsFeatureRequest &request = QgsFeatureRequest() ) const;

%Docstring
Query the layer for features specified in request.
\param request feature request describing parameters of features to return
Expand Down
3 changes: 2 additions & 1 deletion src/core/qgsvectordataprovider.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class QTextCodec;
#include "qgsmaplayerdependency.h"
#include "qgsrelation.h"
#include "qgsfeaturesink.h"
#include "qgsfeaturesource.h"

typedef QList<int> QgsAttributeList SIP_SKIP;
typedef QSet<int> QgsAttributeIds SIP_SKIP;
Expand All @@ -50,7 +51,7 @@ class QgsFeedback;
*
*
*/
class CORE_EXPORT QgsVectorDataProvider : public QgsDataProvider, public QgsFeatureSink
class CORE_EXPORT QgsVectorDataProvider : public QgsDataProvider, public QgsFeatureSink, public QgsFeatureSource
{
Q_OBJECT

Expand Down
5 changes: 3 additions & 2 deletions src/core/qgsvectorlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "qgsmaplayer.h"
#include "qgsfeature.h"
#include "qgsfeaturerequest.h"
#include "qgsfeaturesource.h"
#include "qgsfields.h"
#include "qgsvectordataprovider.h"
#include "qgsvectorsimplifymethod.h"
Expand Down Expand Up @@ -346,7 +347,7 @@ typedef QSet<int> QgsAttributeIds;
* TODO QGIS3: Remove virtual from non-inherited methods (like isModified)
* \see QgsVectorLayerUtils()
*/
class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionContextGenerator, public QgsFeatureSink
class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionContextGenerator, public QgsFeatureSink, public QgsFeatureSource
{
Q_OBJECT

Expand Down Expand Up @@ -859,7 +860,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
* \param request feature request describing parameters of features to return
* \returns iterator for matching features from provider
*/
QgsFeatureIterator getFeatures( const QgsFeatureRequest &request = QgsFeatureRequest() ) const;
QgsFeatureIterator getFeatures( const QgsFeatureRequest &request = QgsFeatureRequest() ) const override;

/**
* Query the layer for features matching a given expression.
Expand Down

0 comments on commit 8bfeb8f

Please sign in to comment.