Class: QgsIFeatureSelectionManager¶
Is an interface class to abstract feature selection handling.
e.g. QgsVectorLayer
implements this interface to manage its
selections.
Class Hierarchy¶
Base classes¶
Methods
Deselect features by feature ids. |
|
Select features by feature ids. |
|
Returns the number of features that are selected in this layer. |
|
Returns reference to identifiers of selected features |
|
Change selection to the new set of features. |
Signals
Emitted when selection was changed. |
- class qgis.gui.QgsIFeatureSelectionManager[source]¶
Bases:
QObject
- selectedFeatureCount(self) int [source]¶
Returns the number of features that are selected in this layer.
- Return type:
int
- selectedFeatureIds(self) Any ¶
Returns reference to identifiers of selected features
- Return type:
Any
- Returns:
A list of selected
QgsFeatureId
See also
- signal selectionChanged(selected: QgsFeatureIds, deselected: QgsFeatureIds, clearAndSelect: bool)[source]¶
Emitted when selection was changed.
- Parameters:
selected (QgsFeatureIds) – Newly selected feature ids
deselected (QgsFeatureIds) – Ids of all features which have previously been selected but are not any more
clearAndSelect (bool) – In case this is set to
True
, the old selection was dismissed and the new selection corresponds to selected
- setSelectedFeatures(self, ids: Any)[source]¶
Change selection to the new set of features. Dismisses the current selection. Will emit the
selectionChanged()
signal with the clearAndSelect flag set.- Parameters:
ids (Any) – The ids which will be the new selection
See also