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 3, 2021
1 parent 72facb0 commit 168f7f6
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:
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

Expand All @@ -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 );
Expand Down
9 changes: 8 additions & 1 deletion src/core/qgsfeaturerequest.h
Expand Up @@ -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 );
Expand Down

0 comments on commit 168f7f6

Please sign in to comment.