Skip to content

Commit dbab4a2

Browse files
committed
update QgsVectorLayer bindings (fixes #6550)
1 parent f93f844 commit dbab4a2

File tree

2 files changed

+25
-17
lines changed

2 files changed

+25
-17
lines changed

python/core/qgsvectorlayer.sip

+23-15
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,10 @@ class QgsVectorLayer : QgsMapLayer
172172
QList<QgsFeature> selectedFeatures();
173173

174174
/** Return reference to identifiers of selected features */
175-
const QSet<qint64> &selectedFeaturesIds() const;
175+
const QgsFeatureIds &selectedFeaturesIds() const;
176176

177177
/** Change selection to the new set of features */
178-
void setSelectedFeatures( const QSet<qint64> &ids );
178+
void setSelectedFeatures( const QgsFeatureIds &ids );
179179

180180
/** Returns the bounding box of the selected features. If there is no selection, QgsRectangle(0,0,0,0) is returned */
181181
QgsRectangle boundingBoxOfSelected();
@@ -317,7 +317,7 @@ class QgsVectorLayer : QgsMapLayer
317317

318318
/**Gets the feature at the given feature id. Considers the changed, added, deleted and permanent features
319319
@return true in case of success*/
320-
bool featureAtId( qint64 featureId, QgsFeature &f, bool fetchGeometries = true, bool fetchAttributes = true );
320+
bool featureAtId( QgsFeatureId featureId, QgsFeature &f, bool fetchGeometries = true, bool fetchAttributes = true );
321321

322322
/** Adds a feature
323323
@param f feature to add
@@ -337,17 +337,17 @@ class QgsVectorLayer : QgsMapLayer
337337
* in the given ring, item (first number is index 0), and feature
338338
* Not meaningful for Point geometries
339339
*/
340-
bool insertVertex( double x, double y, qint64 atFeatureId, int beforeVertex );
340+
bool insertVertex( double x, double y, QgsFeatureId atFeatureId, int beforeVertex );
341341

342342
/** Moves the vertex at the given position number,
343343
* ring and item (first number is index 0), and feature
344344
* to the given coordinates
345345
*/
346-
bool moveVertex( double x, double y, qint64 atFeatureId, int atVertex );
346+
bool moveVertex( double x, double y, QgsFeatureId atFeatureId, int atVertex );
347347

348348
/** Deletes a vertex from a feature
349349
*/
350-
bool deleteVertex( qint64 atFeatureId, int atVertex );
350+
bool deleteVertex( QgsFeatureId atFeatureId, int atVertex );
351351

352352
/** Deletes the selected features
353353
* @return true in case of success and false otherwise
@@ -381,7 +381,7 @@ class QgsVectorLayer : QgsMapLayer
381381
@param dx translation of x-coordinate
382382
@param dy translation of y-coordinate
383383
@return 0 in case of success*/
384-
int translateFeature( qint64 featureId, double dx, double dy );
384+
int translateFeature( QgsFeatureId featureId, double dx, double dy );
385385

386386
/**Splits features cut by the given line
387387
* @param splitLine line that splits the layer features
@@ -498,10 +498,10 @@ class QgsVectorLayer : QgsMapLayer
498498

499499
/** change feature's geometry
500500
@note added in version 1.2 */
501-
bool changeGeometry( qint64 fid, QgsGeometry* geom );
501+
bool changeGeometry( QgsFeatureId fid, QgsGeometry* geom );
502502

503503
/** changed an attribute value (but does not commit it) */
504-
bool changeAttributeValue( qint64 fid, int field, QVariant value, bool emitSignal = true );
504+
bool changeAttributeValue( QgsFeatureId fid, int field, QVariant value, bool emitSignal = true );
505505

506506
/** add an attribute field (but does not commit it)
507507
returns true if the field was added
@@ -525,14 +525,22 @@ class QgsVectorLayer : QgsMapLayer
525525
@note added in version 1.2*/
526526
QString attributeDisplayName( int attributeIndex ) const;
527527

528+
const QMap< QString, QString >& attributeAliases() const;
529+
530+
const QSet<QString>& excludeAttributesWMS() const;
531+
void setExcludeAttributesWMS( const QSet<QString>& att );
532+
533+
const QSet<QString>& excludeAttributesWFS() const;
534+
void setExcludeAttributesWFS( const QSet<QString>& att );
535+
528536
/** delete an attribute field (but does not commit it) */
529537
bool deleteAttribute( int attr );
530538

531539
/** Insert a copy of the given features into the layer (but does not commit it) */
532540
bool addFeatures( QList<QgsFeature> features, bool makeSelected = true );
533541

534542
/** delete a feature from the layer (but does not commit it) */
535-
bool deleteFeature( qint64 fid );
543+
bool deleteFeature( QgsFeatureId fid );
536544

537545
/**
538546
Attempts to commit any changes to disk. Returns the result of the attempt.
@@ -640,7 +648,7 @@ class QgsVectorLayer : QgsMapLayer
640648
/** Execute redo operation. To be called only from QgsVectorLayerUndoCommand.
641649
* @note not available in python bindings
642650
*/
643-
// redoEditCommand( QgsUndoCommand* cmd );
651+
// void redoEditCommand( QgsUndoCommand* cmd );
644652

645653
/** Returns the index of a field name or -1 if the field does not exist
646654
@note this method was added in version 1.4
@@ -685,10 +693,10 @@ class QgsVectorLayer : QgsMapLayer
685693

686694
public slots:
687695
/** Select feature by its ID, optionally emit signal selectionChanged() */
688-
void select( qint64 featureId, bool emitSignal = true );
696+
void select( QgsFeatureId featureId, bool emitSignal = true );
689697

690698
/** Deselect feature by its ID, optionally emit signal selectionChanged() */
691-
void deselect( qint64 featureId, bool emitSignal = true );
699+
void deselect( QgsFeatureId featureId, bool emitSignal = true );
692700

693701
/** Clear selection */
694702
void removeSelection( bool emitSignal = true );
@@ -718,8 +726,8 @@ class QgsVectorLayer : QgsMapLayer
718726
void editingStopped();
719727
void attributeAdded( int idx );
720728
void attributeDeleted( int idx );
721-
void featureAdded( qint64 fid ); // added in 1.7
722-
void featureDeleted( qint64 fid );
729+
void featureAdded( QgsFeatureId fid ); // added in 1.7
730+
void featureDeleted( QgsFeatureId fid );
723731
void layerDeleted();
724732

725733
void attributeValueChanged( QgsFeatureId fid, int idx, const QVariant & );

src/app/qgsidentifyresults.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ class QgsIdentifyResults: public QDialog, private Ui::QgsIdentifyResultsBase
115115

116116
void on_mExpandNewToolButton_toggled( bool checked );
117117

118-
void on_mExpandToolButton_clicked( bool checked ) { expandAll(); }
119-
void on_mCollapseToolButton_clicked( bool checked ) { collapseAll(); }
118+
void on_mExpandToolButton_clicked( bool checked ) { Q_UNUSED( checked); expandAll(); }
119+
void on_mCollapseToolButton_clicked( bool checked ) { Q_UNUSED( checked); collapseAll(); }
120120

121121
void openUrl( const QUrl &url );
122122

0 commit comments

Comments
 (0)