@@ -207,7 +207,7 @@ class QgsVectorLayer : QgsMapLayer
207
207
*
208
208
* @return The expression which will be used to preview features for this layer
209
209
*/
210
- const QString displayExpression();
210
+ QString displayExpression() const ;
211
211
212
212
/** Returns the data provider */
213
213
QgsVectorDataProvider* dataProvider();
@@ -269,7 +269,7 @@ class QgsVectorLayer : QgsMapLayer
269
269
*
270
270
* @note added in 2.9
271
271
*/
272
- const QString expressionField( int index );
272
+ QString expressionField( int index ) const ;
273
273
274
274
/**
275
275
* Changes the expression used to define an expression based (virtual) field
@@ -297,7 +297,7 @@ class QgsVectorLayer : QgsMapLayer
297
297
*
298
298
* @return See description
299
299
*/
300
- int selectedFeatureCount();
300
+ int selectedFeatureCount() const ;
301
301
302
302
/**
303
303
* Select features found within the search rectangle (in layer's coordinates)
@@ -364,7 +364,7 @@ class QgsVectorLayer : QgsMapLayer
364
364
void selectAll();
365
365
366
366
/** Get all feature Ids */
367
- QgsFeatureIds allFeatureIds();
367
+ QgsFeatureIds allFeatureIds() const ;
368
368
369
369
/**
370
370
* Invert selection of features found within the search rectangle (in layer's coordinates)
@@ -383,7 +383,7 @@ class QgsVectorLayer : QgsMapLayer
383
383
* @see selectedFeaturesIds()
384
384
* @see selectedFeaturesIterator() which is more memory friendly when handling large selections
385
385
*/
386
- QgsFeatureList selectedFeatures();
386
+ QgsFeatureList selectedFeatures() const ;
387
387
388
388
/**
389
389
* Get an iterator of the selected features
@@ -396,7 +396,7 @@ class QgsVectorLayer : QgsMapLayer
396
396
* @see selectedFeaturesIds()
397
397
* @see selectedFeatures()
398
398
*/
399
- QgsFeatureIterator selectedFeaturesIterator( QgsFeatureRequest request = QgsFeatureRequest() );
399
+ QgsFeatureIterator selectedFeaturesIterator( QgsFeatureRequest request = QgsFeatureRequest() ) const ;
400
400
401
401
/**
402
402
* Return reference to identifiers of selected features
@@ -417,7 +417,7 @@ class QgsVectorLayer : QgsMapLayer
417
417
void setSelectedFeatures( const QgsFeatureIds &ids ) /Deprecated/;
418
418
419
419
/** Returns the bounding box of the selected features. If there is no selection, QgsRectangle(0,0,0,0) is returned */
420
- QgsRectangle boundingBoxOfSelected();
420
+ QgsRectangle boundingBoxOfSelected() const ;
421
421
422
422
/** Returns whether the layer contains labels which are enabled and should be drawn.
423
423
* @return true if layer contains enabled labels
@@ -573,7 +573,7 @@ class QgsVectorLayer : QgsMapLayer
573
573
* @param symbol the symbol
574
574
* @return number of features rendered by symbol or -1 if failed or counts are not available
575
575
*/
576
- long featureCount( QgsSymbolV2* symbol );
576
+ long featureCount( QgsSymbolV2* symbol ) const ;
577
577
578
578
/**
579
579
* Update the data source of the layer. The layer's renderer and legend will be preserved only
@@ -607,7 +607,7 @@ class QgsVectorLayer : QgsMapLayer
607
607
* Get the string (typically sql) used to define a subset of the layer
608
608
* @return The subset string or QString::null if not implemented by the provider
609
609
*/
610
- virtual QString subsetString();
610
+ virtual QString subsetString() const ;
611
611
612
612
/**
613
613
* Query the layer for features specified in request.
@@ -1085,7 +1085,7 @@ class QgsVectorLayer : QgsMapLayer
1085
1085
* that the user has some chance of repairing the damage cleanly.
1086
1086
*/
1087
1087
bool commitChanges();
1088
- const QStringList & commitErrors();
1088
+ QStringList commitErrors() const ;
1089
1089
1090
1090
/** Stop editing and discard the edits
1091
1091
* @param deleteBuffer whether to delete editing buffer
@@ -1235,15 +1235,15 @@ class QgsVectorLayer : QgsMapLayer
1235
1235
RangeData range( int idx ) /Deprecated/;
1236
1236
1237
1237
/** Access value relation widget data */
1238
- ValueRelationData valueRelation( int idx );
1238
+ ValueRelationData valueRelation( int idx ) const ;
1239
1239
1240
1240
/**
1241
1241
* Get relations, where the foreign key is on this layer
1242
1242
*
1243
1243
* @param idx Only get relations, where idx forms part of the foreign key
1244
1244
* @return A list of relations
1245
1245
*/
1246
- QList<QgsRelation> referencingRelations( int idx );
1246
+ QList<QgsRelation> referencingRelations( int idx ) const ;
1247
1247
1248
1248
/**
1249
1249
* Access date format
@@ -1324,13 +1324,13 @@ class QgsVectorLayer : QgsMapLayer
1324
1324
* @param uniqueValues out: result list
1325
1325
* @param limit maximum number of values to return (-1 if unlimited)
1326
1326
*/
1327
- void uniqueValues( int index, QList<QVariant> &uniqueValues /Out/, int limit = -1 );
1327
+ void uniqueValues( int index, QList<QVariant> &uniqueValues /Out/, int limit = -1 ) const ;
1328
1328
1329
1329
/** Returns minimum value for an attribute column or invalid variant in case of error */
1330
- QVariant minimumValue( int index );
1330
+ QVariant minimumValue( int index ) const ;
1331
1331
1332
1332
/** Returns maximum value for an attribute column or invalid variant in case of error */
1333
- QVariant maximumValue( int index );
1333
+ QVariant maximumValue( int index ) const ;
1334
1334
1335
1335
/** Calculates an aggregated value from the layer's features.
1336
1336
* @param aggregate aggregate to calculate
@@ -1345,7 +1345,7 @@ class QgsVectorLayer : QgsMapLayer
1345
1345
const QString& fieldOrExpression,
1346
1346
const QgsAggregateCalculator::AggregateParameters& parameters = QgsAggregateCalculator::AggregateParameters(),
1347
1347
QgsExpressionContext* context = nullptr,
1348
- bool* ok = nullptr );
1348
+ bool* ok = nullptr ) const ;
1349
1349
1350
1350
/** Fetches all values from a specified field name or expression.
1351
1351
* @param fieldOrExpression field name or an expression string
@@ -1355,7 +1355,7 @@ class QgsVectorLayer : QgsMapLayer
1355
1355
* @note added in QGIS 2.9
1356
1356
* @see getDoubleValues
1357
1357
*/
1358
- QList< QVariant > getValues( const QString &fieldOrExpression, bool &ok, bool selectedOnly = false );
1358
+ QList< QVariant > getValues( const QString &fieldOrExpression, bool &ok, bool selectedOnly = false ) const ;
1359
1359
1360
1360
/** Fetches all double values from a specified field name or expression. Null values or
1361
1361
* invalid expression results are skipped.
@@ -1367,7 +1367,7 @@ class QgsVectorLayer : QgsMapLayer
1367
1367
* @note added in QGIS 2.9
1368
1368
* @see getValues
1369
1369
*/
1370
- QList< double > getDoubleValues( const QString &fieldOrExpression, bool &ok, bool selectedOnly = false, int* nullCount = 0 );
1370
+ QList< double > getDoubleValues( const QString &fieldOrExpression, bool &ok, bool selectedOnly = false, int* nullCount = 0 ) const ;
1371
1371
1372
1372
/** Set the blending mode used for rendering each feature */
1373
1373
void setFeatureBlendMode( QPainter::CompositionMode blendMode );
0 commit comments