Skip to content
Permalink
Browse files
Added QgsVectorLayer::deselect()
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 635abe2b88db79f59e9d607d745471919854d5e6
Showing with 16 additions and 0 deletions.
  1. +3 −0 python/core/qgsvectorlayer.sip
  2. +10 −0 src/core/qgsvectorlayer.cpp
  3. +3 −0 src/core/qgsvectorlayer.h
@@ -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);

@@ -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
@@ -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 );

0 comments on commit 635abe2

Please sign in to comment.