Class: QgsFeatureSelectionModel¶
Class Hierarchy¶
Base classes¶
Methods
Enables or disables synchronisation to the |
|
Returns the selection status of a given feature id. |
|
Overwritten to do NOTHING (we handle selection ourselves) |
|
Select features on this table. |
|
Signals
Request a repaint of the visible items of connected views. |
- class qgis.gui.QgsFeatureSelectionModel(model: QAbstractItemModel | None, featureModel: QgsFeatureModel | None, featureSelectionHandler: QgsIFeatureSelectionManager | None, parent: QObject | None)[source]¶
Bases:
QItemSelectionModel
- enableSync(self, enable: bool)[source]¶
Enables or disables synchronisation to the
QgsVectorLayer
When synchronisation is disabled, any selection change will be buffered inside this selection model. When enabled, any buffered changes are communicated to the layer and the buffer is emptied. Mainly to be used for performance reasons, because selection change on the layer can cost time as it repaints the layer.- Parameters:
enable (bool) – The synchronisation status to set.
- isSelected(self, fid: int) bool [source]¶
Returns the selection status of a given feature id.
- Parameters:
fid (int) – The featureid to determine the selection status of
- Return type:
bool
- Returns:
The selection status
- isSelected(self, index: QModelIndex) bool [source]
Returns the selection status of a given QModelIndex.
- Parameters:
index (QModelIndex) – The index to determine the selection status of
- Return type:
bool
- Returns:
The selection status
- signal requestRepaint[source]¶
Request a repaint of the visible items of connected views. Views using this model should connect to and properly process this signal.
- select(self, index: QModelIndex, command: QItemSelectionModel.SelectionFlags | QItemSelectionModel.SelectionFlag)[source]¶
Overwritten to do NOTHING (we handle selection ourselves)
See also
- Parameters:
index (QModelIndex)
command (Union[QItemSelectionModel.SelectionFlags, QItemSelectionModel.SelectionFlag])
- select(self, selection: QItemSelection, command: QItemSelectionModel.SelectionFlags | QItemSelectionModel.SelectionFlag)[source]
Overwritten to do NOTHING (we handle selection ourselves)
See also
- Parameters:
selection (QItemSelection)
command (Union[QItemSelectionModel.SelectionFlags, QItemSelectionModel.SelectionFlag])
- selectFeatures(self, selection: QItemSelection, command: QItemSelectionModel.SelectionFlags | QItemSelectionModel.SelectionFlag)[source]¶
Select features on this table. Is to be used in favor of the stock select methods.
- Parameters:
selection (QItemSelection) – The QItemSelection which will be selected
command (Union[QItemSelectionModel.SelectionFlags, QItemSelectionModel.SelectionFlag]) – The command to apply. Select, Deselect and ClearAndSelect are processed.
- setFeatureSelectionManager(self, featureSelectionManager: QgsIFeatureSelectionManager | None)[source]¶
- Parameters:
featureSelectionManager (Optional[QgsIFeatureSelectionManager])