Skip to content
Permalink
Browse files
Added QgsVectorLayer::deselect()
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@9729 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Dec 2, 2008
1 parent 8fa4cec commit e223a5860f9cb119279a4ba6d245869c0fc558b5
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 e223a58

Please sign in to comment.