25 mFilterExtent = extent;
31 mFilterGeometryType = geometryType;
43 mFilterMapLayerType = mapLayerType;
49 QModelIndex index0 = sourceModel()->index( sourceRow, 0, sourceParent );
50 bool result { QSortFilterProxyModel::filterAcceptsRow( sourceRow, sourceParent ) };
56 if ( ! mFilterString.isEmpty() )
58 result = result && metadataResult.
contains( mFilterString );
61 if ( result && ! mFilterExtent.
isEmpty() )
64 result = result && ( metadataResult.geometryType() != Qgis::GeometryType::Unknown && metadataResult.geometryType() != Qgis::GeometryType::Null ) && mFilterExtent.
intersects( metadataResult.geographicExtent().boundingBox() );
67 if ( result && mFilterMapLayerTypeEnabled )
69 result = result && metadataResult.layerType() == mFilterMapLayerType;
72 if ( result && mFilterGeometryTypeEnabled )
74 if ( mFilterGeometryType == Qgis::GeometryType::Unknown || mFilterGeometryType == Qgis::GeometryType::Null )
76 result = result && ( metadataResult.geometryType() == Qgis::GeometryType::Unknown || metadataResult.geometryType() == Qgis::GeometryType::Null );
80 result = result && metadataResult.geometryType() == mFilterGeometryType;
90 mFilterMapLayerTypeEnabled = enabled;
96 mFilterGeometryTypeEnabled = enabled;
102 return mFilterString;
GeometryType
The geometry types are used to group Qgis::WkbType in a coarse way.
LayerType
Types of layers that can be added to a map.
A rectangle specified with double values.
bool intersects(const QgsRectangle &rect) const SIP_HOLDGIL
Returns true when rectangle intersects with other rectangle.
bool isEmpty() const
Returns true if the rectangle is empty.