Class: QgsIFeatureSelectionManager

class qgis.gui.QgsIFeatureSelectionManager

Bases: PyQt5.QtCore.QObject

Is an interface class to abstract feature selection handling.

e.g. QgsVectorLayer implements this interface to manage its selections.

Methods

childEvent

connectNotify

customEvent

deselect

Deselect features by feature ids.

disconnectNotify

isSignalConnected

receivers

select

Select features by feature ids.

selectedFeatureCount

Returns the number of features that are selected in this layer.

selectedFeatureIds

Returns reference to identifiers of selected features

sender

senderSignalIndex

setSelectedFeatures

Change selection to the new set of features.

timerEvent

Signals

selectionChanged

Emitted when selection was changed.

childEvent()
connectNotify()
customEvent()
deselect(self, ids: object)

Deselect features by feature ids.

Parameters

ids (object) –

disconnectNotify()
isSignalConnected()
receivers()
select(self, ids: object)

Select features by feature ids.

Parameters

ids (object) –

selectedFeatureCount(self) → int

Returns the number of features that are selected in this layer.

Return type

int

selectedFeatureIds(self) → object

Returns reference to identifiers of selected features

Return type

object

Returns

A list of QgsFeatureId’s

selectionChanged

Emitted when selection was changed.

Parameters
  • selected (object) – Newly selected feature ids

  • deselected (object) – 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 [signal]

sender()
senderSignalIndex()
setSelectedFeatures(self, ids: object)

Change selection to the new set of features. Dismisses the current selection. Will emit the selectionChanged( const :py:class:`QgsFeatureIds`&, const :py:class:`QgsFeatureIds`&, bool ) signal with the clearAndSelect flag set.

Parameters

ids (object) – The ids which will be the new selection

timerEvent()