Skip to content
Permalink
Browse files
QgsVectorLayer, QgsVectorDataProvider are QgsFeatureSources
  • Loading branch information
nyalldawson committed May 25, 2017
1 parent ce063b8 commit 8bfeb8f73b4ce2ee5c0738377e0be3b334ef5a13
Showing with 9 additions and 6 deletions.
  1. +1 −1 python/core/qgsvectordataprovider.sip
  2. +3 −2 python/core/qgsvectorlayer.sip
  3. +2 −1 src/core/qgsvectordataprovider.h
  4. +3 −2 src/core/qgsvectorlayer.h
@@ -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.
@@ -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.
@@ -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
@@ -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;
@@ -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

@@ -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"
@@ -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

@@ -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.

0 comments on commit 8bfeb8f

Please sign in to comment.