mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-15 00:04:00 -04:00
add QgsFeatureRequest::setNoAttributes (#8326)
since it's more convenient than setSubsetOfAttributes( QgsAttributesList() )
This commit is contained in:
parent
653a668531
commit
699d8487dc
@ -513,6 +513,15 @@ Set a subset of attributes that will be fetched.
|
||||
An empty attributes list indicates that no attributes will be fetched.
|
||||
To revert a call to setSubsetOfAttributes and fetch all available attributes,
|
||||
the SubsetOfAttributes flag should be removed from the request.
|
||||
%End
|
||||
|
||||
QgsFeatureRequest &setNoAttributes();
|
||||
%Docstring
|
||||
Set that no attributes will be fetched.
|
||||
To revert a call to setNoAttributes and fetch all or some available attributes,
|
||||
the SubsetOfAttributes flag should be removed from the request.
|
||||
|
||||
.. versionadded:: 3.4
|
||||
%End
|
||||
|
||||
QgsAttributeList subsetOfAttributes() const;
|
||||
|
@ -190,6 +190,11 @@ QgsFeatureRequest &QgsFeatureRequest::setSubsetOfAttributes( const QgsAttributeL
|
||||
return *this;
|
||||
}
|
||||
|
||||
QgsFeatureRequest &QgsFeatureRequest::setNoAttributes()
|
||||
{
|
||||
return setSubsetOfAttributes( QgsAttributeList() );
|
||||
}
|
||||
|
||||
QgsFeatureRequest &QgsFeatureRequest::setSubsetOfAttributes( const QStringList &attrNames, const QgsFields &fields )
|
||||
{
|
||||
if ( attrNames.contains( QgsFeatureRequest::ALL_ATTRIBUTES ) )
|
||||
|
@ -501,6 +501,14 @@ class CORE_EXPORT QgsFeatureRequest
|
||||
*/
|
||||
QgsFeatureRequest &setSubsetOfAttributes( const QgsAttributeList &attrs );
|
||||
|
||||
/**
|
||||
* Set that no attributes will be fetched.
|
||||
* To revert a call to setNoAttributes and fetch all or some available attributes,
|
||||
* the SubsetOfAttributes flag should be removed from the request.
|
||||
* \since QGIS 3.4
|
||||
*/
|
||||
QgsFeatureRequest &setNoAttributes();
|
||||
|
||||
/**
|
||||
* Returns the subset of attributes which at least need to be fetched
|
||||
* \returns A list of attributes to be fetched
|
||||
|
Loading…
x
Reference in New Issue
Block a user