Skip to content

Commit

Permalink
Added QgsVectorLayer::deselect()
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@9729 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Dec 2, 2008
1 parent 3d97dc4 commit 635abe2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions python/core/qgsvectorlayer.sip
Expand Up @@ -367,6 +367,9 @@ public slots:
/** Select feature by its ID, optionally emit signal selectionChanged() */
void select(int featureId, bool emitSignal = TRUE);

/** Deselect feature by its ID, optionally emit signal selectionChanged() */
void deselect( int featureId, bool emitSignal = TRUE );

/** Clear selection */
void removeSelection(bool emitSignal = TRUE);

Expand Down
10 changes: 10 additions & 0 deletions src/core/qgsvectorlayer.cpp
Expand Up @@ -820,6 +820,16 @@ void QgsVectorLayer::select( int number, bool emitSignal )
}
}

void QgsVectorLayer::deselect( int number, bool emitSignal )
{
mSelectedFeatureIds.remove( number );

if ( emitSignal )
{
emit selectionChanged();
}
}

void QgsVectorLayer::select( QgsRectangle & rect, bool lock )
{
// normalize the rectangle
Expand Down
3 changes: 3 additions & 0 deletions src/core/qgsvectorlayer.h
Expand Up @@ -424,6 +424,9 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer
public slots:
/** Select feature by its ID, optionally emit signal selectionChanged() */
void select( int featureId, bool emitSignal = TRUE );

/** Deselect feature by its ID, optionally emit signal selectionChanged() */
void deselect( int featureId, bool emitSignal = TRUE );

/** Clear selection */
void removeSelection( bool emitSignal = TRUE );
Expand Down

0 comments on commit 635abe2

Please sign in to comment.