Skip to content

Commit

Permalink
Fix Python based data providers on newer SIP versions
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Feb 8, 2021
1 parent e509e65 commit 0aab307
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 4 additions & 1 deletion python/core/auto_generated/qgsfeaturerequest.sip.in
Expand Up @@ -764,7 +764,9 @@ Base class that can be used for any class that is capable of returning features
public: public:
virtual ~QgsAbstractFeatureSource(); virtual ~QgsAbstractFeatureSource();


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

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


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



protected: protected:
void iteratorOpened( QgsAbstractFeatureIterator *it ); void iteratorOpened( QgsAbstractFeatureIterator *it );
void iteratorClosed( QgsAbstractFeatureIterator *it ); void iteratorClosed( QgsAbstractFeatureIterator *it );
Expand Down
9 changes: 8 additions & 1 deletion src/core/qgsfeaturerequest.h
Expand Up @@ -744,12 +744,19 @@ class CORE_EXPORT QgsAbstractFeatureSource
public: public:
virtual ~QgsAbstractFeatureSource(); 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 * Gets an iterator for features matching the specified request
* \param request The request * \param request The request
* \returns A feature iterator * \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: protected:
void iteratorOpened( QgsAbstractFeatureIterator *it ); void iteratorOpened( QgsAbstractFeatureIterator *it );
Expand Down

0 comments on commit 0aab307

Please sign in to comment.