Skip to content
Permalink
Browse files

Fix Python based data providers on newer SIP versions

  • Loading branch information
nyalldawson committed Feb 8, 2021
1 parent e509e65 commit 0aab3073d811b66696d0c389a66b8a6dfa20602c
Showing with 12 additions and 2 deletions.
  1. +4 −1 python/core/auto_generated/qgsfeaturerequest.sip.in
  2. +8 −1 src/core/qgsfeaturerequest.h
@@ -764,7 +764,9 @@ Base class that can be used for any class that is capable of returning features
public:
virtual ~QgsAbstractFeatureSource();

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


virtual QgsFeatureIterator getFeatures( const QgsFeatureRequest &request = QgsFeatureRequest() ) = 0 /TransferBack/;
%Docstring
Gets an iterator for features matching the specified request

@@ -773,6 +775,7 @@ Gets an iterator for features matching the specified request
:return: A feature iterator
%End


protected:
void iteratorOpened( QgsAbstractFeatureIterator *it );
void iteratorClosed( QgsAbstractFeatureIterator *it );
@@ -744,12 +744,19 @@ class CORE_EXPORT QgsAbstractFeatureSource
public:
virtual ~QgsAbstractFeatureSource();


// IMPORTANT -- do NOT remove the /TransferBack/ annotation here -- while it looks completely wrong, it's
// required for Python data providers to work correctly! Argh!

/**
* Gets an iterator for features matching the specified request
* \param request The request
* \returns A feature iterator
*/
virtual QgsFeatureIterator getFeatures( const QgsFeatureRequest &request = QgsFeatureRequest() ) = 0;
virtual QgsFeatureIterator getFeatures( const QgsFeatureRequest &request = QgsFeatureRequest() ) = 0 SIP_TRANSFERBACK;

// IMPORTANT -- do NOT remove the /TransferBack/ annotation here -- while it looks completely wrong, it's
// required for Python data providers to work correctly! Argh!

protected:
void iteratorOpened( QgsAbstractFeatureIterator *it );

0 comments on commit 0aab307

Please sign in to comment.