Skip to content

Commit

Permalink
Apply FilterRect in combination with other filters
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Jul 29, 2015
1 parent b47b9a5 commit cfe91f8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/core/qgsfeaturerequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ QgsFeatureRequest::~QgsFeatureRequest()

QgsFeatureRequest& QgsFeatureRequest::setFilterRect( const QgsRectangle& rect )
{
mFilter = FilterRect;
mFilterRect = rect;
return *this;
}
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsfeaturerequest.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class CORE_EXPORT QgsFeatureRequest
enum FilterType
{
FilterNone, //!< No filter is applied
FilterRect, //!< Filter using a rectangle, no need to set NoGeometry
FilterRect, //!< Obsolete, will be ignored. If a filterRect is set it will be used anyway. Filter using a rectangle, no need to set NoGeometry. Instead check for request.filterRect().isNull()
FilterFid, //!< Filter using feature ID
FilterExpression, //!< Filter using expression
FilterFids //!< Filter using feature IDs
Expand All @@ -93,7 +93,7 @@ class CORE_EXPORT QgsFeatureRequest

~QgsFeatureRequest();

FilterType filterType() const { return mFilter; }
FilterType filterType() const { if ( mFilter == FilterNone && !mFilterRect.isNull() ) return FilterRect; else return mFilter; }

//! Set rectangle from which features will be taken. Empty rectangle removes the filter.
//!
Expand Down

0 comments on commit cfe91f8

Please sign in to comment.