Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
const correctness QgsVectorLayer::deleteAttributes
- Loading branch information
|
@@ -1679,7 +1679,7 @@ Deletes an attribute field (but does not commit it). |
|
|
changes can be discarded by calling rollBack(). |
|
|
%End |
|
|
|
|
|
bool deleteAttributes( QList<int> attrs ); |
|
|
bool deleteAttributes( const QList<int> &attrs ); |
|
|
%Docstring |
|
|
Deletes a list of attribute fields (but does not commit it) |
|
|
|
|
@@ -2559,6 +2559,8 @@ Sets the extent |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/************************************************************************ |
|
|
* This file has been generated automatically from * |
|
|
* * |
|
|
|
@@ -2677,16 +2677,16 @@ bool QgsVectorLayer::deleteAttribute( int index ) |
|
|
return mEditBuffer->deleteAttribute( index ); |
|
|
} |
|
|
|
|
|
bool QgsVectorLayer::deleteAttributes( QList<int> attrs ) |
|
|
bool QgsVectorLayer::deleteAttributes( const QList<int> &attrs ) |
|
|
{ |
|
|
bool deleted = false; |
|
|
|
|
|
// Remove multiple occurrences of same attribute |
|
|
attrs = attrs.toSet().toList(); |
|
|
QList<int> attrList = attrs.toSet().toList(); |
|
|
|
|
|
std::sort( attrs.begin(), attrs.end(), std::greater<int>() ); |
|
|
std::sort( attrList.begin(), attrList.end(), std::greater<int>() ); |
|
|
|
|
|
Q_FOREACH ( int attr, attrs ) |
|
|
for ( int attr : qgis::as_const( attrList ) ) |
|
|
{ |
|
|
if ( deleteAttribute( attr ) ) |
|
|
{ |
|
|
|
@@ -1546,7 +1546,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte |
|
|
* \returns true if at least one attribute has been deleted |
|
|
* |
|
|
*/ |
|
|
bool deleteAttributes( QList<int> attrs ); |
|
|
bool deleteAttributes( const QList<int> &attrs ); |
|
|
|
|
|
bool addFeatures( QgsFeatureList &features, QgsFeatureSink::Flags flags = nullptr ) override; |
|
|
|
|
@@ -2457,6 +2457,8 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte |
|
|
friend class QgsVectorLayerFeatureSource; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
// clazy:excludeall=qstring-allocations |
|
|
|
|
|
#endif |