mirror of
https://github.com/qgis/QGIS.git
synced 2025-12-07 00:03:52 -05:00
QgsVectorLayer: deprecate old API: select(), nextFeature(), featureAtId()
This commit is contained in:
parent
5ad61f535a
commit
8da06cb97d
@ -54,12 +54,6 @@ class QgsVectorDataProvider : QgsDataProvider
|
|||||||
*/
|
*/
|
||||||
virtual QgsFeatureIterator getFeatures( const QgsFeatureRequest& request = QgsFeatureRequest() ) = 0;
|
virtual QgsFeatureIterator getFeatures( const QgsFeatureRequest& request = QgsFeatureRequest() ) = 0;
|
||||||
|
|
||||||
// temporary
|
|
||||||
QgsFeatureIterator select( QList<int> fetchAttributes = QList<int>(),
|
|
||||||
QgsRectangle rect = QgsRectangle(),
|
|
||||||
bool fetchGeometry = true,
|
|
||||||
bool useIntersect = false ) /Deprecated/;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get feature type.
|
* Get feature type.
|
||||||
* @return int representing the feature type
|
* @return int representing the feature type
|
||||||
|
|||||||
@ -302,7 +302,7 @@ class QgsVectorLayer : QgsMapLayer
|
|||||||
void select( QList<int> fetchAttributes,
|
void select( QList<int> fetchAttributes,
|
||||||
QgsRectangle rect = QgsRectangle(),
|
QgsRectangle rect = QgsRectangle(),
|
||||||
bool fetchGeometry = true,
|
bool fetchGeometry = true,
|
||||||
bool useIntersect = false );
|
bool useIntersect = false ) /Deprecated/;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Query the provider for features specified in request.
|
* Query the provider for features specified in request.
|
||||||
@ -314,11 +314,11 @@ class QgsVectorLayer : QgsMapLayer
|
|||||||
* @param feature buffer to read the feature into
|
* @param feature buffer to read the feature into
|
||||||
* @return true, if a feature was fetched, false, if there are no more features
|
* @return true, if a feature was fetched, false, if there are no more features
|
||||||
*/
|
*/
|
||||||
bool nextFeature( QgsFeature& feature );
|
bool nextFeature( QgsFeature& feature ) /Deprecated/;
|
||||||
|
|
||||||
/**Gets the feature at the given feature id. Considers the changed, added, deleted and permanent features
|
/**Gets the feature at the given feature id. Considers the changed, added, deleted and permanent features
|
||||||
@return true in case of success*/
|
@return true in case of success*/
|
||||||
bool featureAtId( QgsFeatureId featureId, QgsFeature &f, bool fetchGeometries = true, bool fetchAttributes = true );
|
bool featureAtId( QgsFeatureId featureId, QgsFeature &f, bool fetchGeometries = true, bool fetchAttributes = true ) /Deprecated/;
|
||||||
|
|
||||||
/** Adds a feature
|
/** Adds a feature
|
||||||
@param f feature to add
|
@param f feature to add
|
||||||
|
|||||||
@ -491,25 +491,4 @@ void QgsVectorDataProvider::pushError( QString msg )
|
|||||||
mErrors << msg;
|
mErrors << msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
QgsFeatureIterator QgsVectorDataProvider::select( QgsAttributeList fetchAttributes,
|
|
||||||
QgsRectangle rect,
|
|
||||||
bool fetchGeometry,
|
|
||||||
bool useIntersect )
|
|
||||||
{
|
|
||||||
qDebug( "OLD SELECT!" );
|
|
||||||
|
|
||||||
QgsFeatureRequest request;
|
|
||||||
if ( !rect.isEmpty() )
|
|
||||||
{
|
|
||||||
request.setFilterRect( rect );
|
|
||||||
}
|
|
||||||
if ( !fetchGeometry )
|
|
||||||
request.setFlags( QgsFeatureRequest::NoGeometry );
|
|
||||||
if ( useIntersect )
|
|
||||||
request.setFlags( request.flags() | QgsFeatureRequest::ExactIntersect );
|
|
||||||
request.setSubsetOfAttributes( fetchAttributes );
|
|
||||||
return getFeatures( request );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
QStringList QgsVectorDataProvider::smEncodings;
|
QStringList QgsVectorDataProvider::smEncodings;
|
||||||
|
|||||||
@ -111,12 +111,6 @@ class CORE_EXPORT QgsVectorDataProvider : public QgsDataProvider
|
|||||||
*/
|
*/
|
||||||
virtual QgsFeatureIterator getFeatures( const QgsFeatureRequest& request = QgsFeatureRequest() ) = 0;
|
virtual QgsFeatureIterator getFeatures( const QgsFeatureRequest& request = QgsFeatureRequest() ) = 0;
|
||||||
|
|
||||||
// temporary
|
|
||||||
QgsFeatureIterator select( QgsAttributeList fetchAttributes,
|
|
||||||
QgsRectangle rect = QgsRectangle(),
|
|
||||||
bool fetchGeometry = true,
|
|
||||||
bool useIntersect = false );
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get feature type.
|
* Get feature type.
|
||||||
* @return int representing the feature type
|
* @return int representing the feature type
|
||||||
|
|||||||
@ -448,16 +448,11 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
|
|||||||
* @param fetchGeometry fetch features with geometry
|
* @param fetchGeometry fetch features with geometry
|
||||||
* @param useIntersect fetch only features that actually intersect the window (not just the bounding box)
|
* @param useIntersect fetch only features that actually intersect the window (not just the bounding box)
|
||||||
*/
|
*/
|
||||||
void select( QgsAttributeList fetchAttributes,
|
Q_DECL_DEPRECATED void select( QgsAttributeList fetchAttributes,
|
||||||
QgsRectangle rect = QgsRectangle(),
|
QgsRectangle rect = QgsRectangle(),
|
||||||
bool fetchGeometry = true,
|
bool fetchGeometry = true,
|
||||||
bool useIntersect = false );
|
bool useIntersect = false );
|
||||||
|
|
||||||
/** Select features based on criteria specified in the request
|
|
||||||
* @note added in 2.0
|
|
||||||
*/
|
|
||||||
//void select( const QgsFeatureRequest& request );
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Query the provider for features specified in request.
|
* Query the provider for features specified in request.
|
||||||
*/
|
*/
|
||||||
@ -468,11 +463,11 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
|
|||||||
* @param feature buffer to read the feature into
|
* @param feature buffer to read the feature into
|
||||||
* @return true, if a feature was fetched, false, if there are no more features
|
* @return true, if a feature was fetched, false, if there are no more features
|
||||||
*/
|
*/
|
||||||
bool nextFeature( QgsFeature& feature );
|
Q_DECL_DEPRECATED bool nextFeature( QgsFeature& feature );
|
||||||
|
|
||||||
/**Gets the feature at the given feature id. Considers the changed, added, deleted and permanent features
|
/**Gets the feature at the given feature id. Considers the changed, added, deleted and permanent features
|
||||||
@return true in case of success*/
|
@return true in case of success*/
|
||||||
bool featureAtId( QgsFeatureId featureId, QgsFeature &f, bool fetchGeometries = true, bool fetchAttributes = true );
|
Q_DECL_DEPRECATED bool featureAtId( QgsFeatureId featureId, QgsFeature &f, bool fetchGeometries = true, bool fetchAttributes = true );
|
||||||
|
|
||||||
/** Adds a feature
|
/** Adds a feature
|
||||||
@param f feature to add
|
@param f feature to add
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user