Skip to content

Commit

Permalink
Add expression constructor to QgsFeatureRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Oct 31, 2013
1 parent d8e5c2f commit 5cd7566
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions python/core/qgsfeaturerequest.sip
Expand Up @@ -30,6 +30,8 @@ class QgsFeatureRequest
explicit QgsFeatureRequest( QgsFeatureId fid );
//! construct a request with rectangle filter
explicit QgsFeatureRequest( const QgsRectangle& rect );
//! construct a request with a filter expression
explicit QgsFeatureRequest( const QgsExpression& expression );

FilterType filterType() const;

Expand Down
7 changes: 7 additions & 0 deletions src/core/qgsfeaturerequest.cpp
Expand Up @@ -42,6 +42,13 @@ QgsFeatureRequest::QgsFeatureRequest( const QgsRectangle& rect )
{
}

QgsFeatureRequest::QgsFeatureRequest( const QgsExpression& expr )
: mFilter( FilterExpression )
, mFilterExpression( new QgsExpression( expr.dump() ) )
, mFlags( 0 )
{
}

QgsFeatureRequest::QgsFeatureRequest( const QgsFeatureRequest &rh )
{
operator=( rh );
Expand Down
2 changes: 2 additions & 0 deletions src/core/qgsfeaturerequest.h
Expand Up @@ -80,6 +80,8 @@ class CORE_EXPORT QgsFeatureRequest
explicit QgsFeatureRequest( QgsFeatureId fid );
//! construct a request with rectangle filter
explicit QgsFeatureRequest( const QgsRectangle& rect );
//! construct a request with a filter expression
explicit QgsFeatureRequest( const QgsExpression& expr );
//! copy constructor
QgsFeatureRequest( const QgsFeatureRequest& rh );

Expand Down

0 comments on commit 5cd7566

Please sign in to comment.